5.8 Example 8: Fitting Functions to Data

The fit command works in PyXPlot in essentially the same way as in gnuplot (see section 2.7). In this example, we take a series of data points, and first fit parabolas through them. For the first fit, $ f(x)$, we do not take the errorbars into account; in the second, $ g(x)$, we do. Then, we use the spline command to fit a spline, $ h(x)$, through the same data (see section 3.8). Strong oscillation is seen in this example because of the angular nature of the data; it is not well-fit by a spline. The output is shown in figure 5.8.




PyXPlot Script:

examples/example8



Dominic Ford 2006-09-09