|
From: Tammo H. <Tam...@ie...> - 2006-03-06 04:00:07
|
Check out 'set label ...' that might help you. Tammo On 5 Mar 2006 at 16:12, Tax, Rick wrote: > > Hello, > > I have a data file with wire caps generated by two different RC extracto= rs. I want to generate a > scatter plot and run a linear regression on the data. Here are the basic= gnuplot commands that I > am using: > > gnuplot> f(x) =3D k*x > gnuplot> fit f(x) "wire.caps" via k > gnuplot> plot "wire.caps", f(x) > > The above commands generate a plot with the data points from file "wire.= caps" along with the > line f(x). By default, the least squares line has the label "f(x)" on th= e plot. Given that the > computed slope k is an important parameter in interpreting the plot and = it will need to be used in > other tools/analysis, I want to include the value of k on the plot. > > gnuplot> show variables > > Variables: > pi =3D 3.14159265358979 > k =3D 1.40150928555715 > > The fit command defined the variable k with the value determined by the = linear regression fit as > shown above with the "show variables" command. Instead of labeling the L= S line with the > default label "f(x)", I would like to label it with "f(x) =3D 1.401*x". = I=B4m looking for something similar > to an sprintf function where I can generate the string "f(x) =3D 1.401*x= " and then use this as the title > of the LS line on the plot command. > > While I=B4m a relative novice at using gnuplot, I could not find any men= tion or examples of doing > this sort of thing. I would think that labeling a plot with calculated d= ata would be something that > gnuplot users would want to do. Can I get gnuplot to label my LS line wi= th "f(x) =3D 1.401*x" > where the 1.401 is the value of k generated by the fit command in the gn= uplot command file > generating the plot? > > BTW, I=B4m using the following version of gnuplot: > > G N U P L O T > Unix version 3.7 > patchlevel 1 > > While we don=B4t have the latest version installed, I did search the lat= est on-line gnuplot > documentation and FAQ at http://www.gnuplot.info which no success. > > Thanks, > Rick > > > > > __________ NOD32 1.1431 (20060305) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > -- Tammo Heeren, Ph.D mailto: Tam...@ie... |