#!/usr/X11R6/bin/robot ! This example shows how to use the "functions" fitvalue and fiterror. ! First do a straight line fit to some data. ! Resets n RESET ! get the data TYPE The title X axis label Y axis label 0.0 7 4 9.9 23 3 21 27 4 29 33 3 40 47 4 ! plot the data G ! The straight line fit itself. CURFIT polynomial 1 1 end ! Plot the fit PLOTCUR ! now plot the same function with the intercept found in the previous ! fits replaced with intercept + error on intercept ! The gradient is allowed to float but starts at the result of the ! previous fit assign a1 fitvalue{1} assign a2 fiterror{1} assign a1 a1+a2 assign a3 fitvalue{2} ! Now the second fit curfit polynomial (a1) a2 end ! and plot the results as a dashed line plotcurd ! Add annotation to the plot text Least squares straight line fit 5 52 ! some arrows arrowhollow arrow 10 7.8 5.0 14.6 text Best fit 11 7 arrow 0.9 40.6 6.2 20.4 text Fit with intercept fixed at best value + error on value 0.0 42