|
From: Thomas S. <t.s...@fz...> - 2011-08-21 11:18:08
|
labels are strings, not numbers. the result of your calculation must be
a string:
plot 'datafile.txt' u 6:7:(sprintf("%f",-2.*$10)) index 1 w labels
andreas oertel wrote:
>
> Hi,
>
> i am using GNUPLOT 4.5 under WinXP with the WXT terminal.
>
> I have got files with data organized in columns divided in several blocks
> and want to plot the data values or calculations with them into the graph.
> Lets say col 6 of the file contains X coordinates, col 7 the Y and col 10
> the data values.
>
> I start to plot the data as label into the graph: plot 'datafile.txt' u
> 6:7:10 index 1 w labels -> works well.
>
> Then i try to perform easy math on my data values: for example
>
> plot 'datafile.txt' u 6:7:(-2.0*$10) index1 w labels
> -> unfortunatly plot just returns the original data values, not the
> multiplication result.
>
> second try:
>
> f(x)=-2.0*x
> plot 'datafile.txt' u 6:7:(f($10)) index 1 w labels
> -> same as above.
>
> On the other hand: plot 'datafile.txt' u ($6+1):($7+1):10 index 1 w labels
> -> shifts the coordinates as expected.
>
> So how to perfom math operation on the third entry of the plot using
> clause or how to print values from calculations to the corresponding
> coordinates??
>
> Thank you in advance,
> Andreas
>
>
--
View this message in context: http://old.nabble.com/plot-using-6%3A7%3A%28%2410%29%2C-how-to-perform-math-on-the-third-entry---tp32298134p32305104.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|