|
From: Tax, R. <rt...@qu...> - 2006-03-05 21:13:27
|
Hello,
=20
I have a data file with wire caps generated by two different RC
extractors. 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:
=20
gnuplot> f(x) =3D k*x
gnuplot> fit f(x) "wire.caps" via k
gnuplot> plot "wire.caps", f(x)
=20
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 the 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.=20
=20
gnuplot> show variables
=20
Variables:
pi =3D 3.14159265358979
k =3D 1.40150928555715
=20
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 LS line with the default label "f(x)", I would
like to label it with "f(x) =3D 1.401*x". I'm 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. =20
=20
While I'm a relative novice at using gnuplot, I could not find any
mention or examples of doing this sort of thing. I would think that
labeling a plot with calculated data would be something that gnuplot
users would want to do. Can I get gnuplot to label my LS line with
"f(x) =3D 1.401*x" where the 1.401 is the value of k generated by the =
fit
command in the gnuplot command file generating the plot?
=20
BTW, I'm using the following version of gnuplot:
=20
G N U P L O T
Unix version 3.7
patchlevel 1
=20
While we don't have the latest version installed, I did search the
latest on-line gnuplot documentation and FAQ at http://www.gnuplot.info
<http://www.gnuplot.info/> which no success.
=20
Thanks,
Rick
=20
|