Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i reduce the linear fit plot to a certain interval?

what i do is to fit two linear function´s to my data. i know how to select the data for the various fitting functions. My problem is that i want the fitted lines only to be plottet in a certain interval. What i did till now:

f(x) = a*x + b; fit [800:1250][-2:8] f(x) 'Daten.txt' u 1:2 via a,b   

g(x) = c*x + d; fit [1258:1650][-2:8] g(x) 'Daten.txt' u 1:2 via c,d                                                                            

plot "Daten.txt" u 1:2 w l, f(x) t title_f(a,b), g(x) t title_g(c,d)                                                            

it results in

a picture i´m not allowed to post...

How can i make the green fittin-line only to run from 800-1200 and the blue fitting-line from 1100-end?

like image 752
esrehmki Avatar asked Jun 14 '13 14:06

esrehmki


1 Answers

The syntax

plot [xmin:xmax] f(x)

(the same as for fit) restricts the plot to a certain range. So, you could do something like

plot "Daten.txt" u 1:2 w l, [800:1200] f(x) t title_f(a,b), [1100:] g(x) t title_g(c,d)
like image 139
andyras Avatar answered Oct 29 '22 20:10

andyras