Chapter 30 Plotting, Bisection, and Least Squares
Scientific computing often means more than just computing a number— we also want to see our results. In this chapter we’ll learn to plot data straight from a C program using gnuplot, and then put that ability to use in two classic scientific-computing problems: finding the root of an equation with the bisection method, and finding the best-fit line through a set of data points with least squares (linear regression). Here’s what we’ll cover:
-
Plotting with gnuplot
-
The bisection method for solving \(f(x) = 0\)
-
Least squares (linear regression)

