Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## Plotting Variables

Help
2006-11-17
2013-02-10

• Dave Clarke
2006-11-17

given variables a1,a2,a3... and b1,b2,b3... found by fitting to different data sets.
How would I then plot the variables in their own graph.
x=a1 y=b2
etc.

Thanks allot
Dave

• One doesn't usually "plot" a variable.  Either you print it to the screen (which 'fit' already does), or you write it onto a plot as a text element (--> "set label").

• iskren_g
2006-11-18

Hi Dave!

why don't you try with:

set label "x", a1, "err", a1_err at <the position you want it> tc lt 3

This way you can plot not only the variable but its error as well. But to plot the error you need to:

set fit errorvariables

in your script before fitting the function.

You might know it already, but the tc lt 3 is setting the text color to the color of line type 3, which is blue. So you can play with the colors to get the one you like.

And if you want to have a fancy .eps, for example, plot including the variables with its +/- errors, you might use some Symbols as well. Here is an example of my script:

set label "M_{TO, LMC}=%5.2f", t2, "\t{/Symbol \261}%5.2f", t2_err  at -7,8.3 tc lt 3
set label "{/Symbol \163}=%5.2f", w2, "\t{/Symbol \261}%5.2f", w2_err  at -5.88,7.8 tc lt 3

With this I just plot the turnover value and its width with their errors of a particular Gaussian distribution from my data.

Hope this was helpful!
Iskren

• Dave Clarke
2006-11-20

hi Iskren
thanks for that. But when I say plot, i want to plot a data point "a1,b1" as actual data points and then fit a curve to them too.
But i will use that error too to fit error bars to it too.

Dave

• Dave Clarke
2006-11-20

although "One doesn't usually "plot" a variable." I still want to!! :)

But if its not possible, ill just have to put them into a data file and do a new plot.
It would just be allot easer if i could produce it with one scipt since im doing it lots of times for different data sets.

Thanks for your help.