On Mon, Jun 27, 2011 at 2:55 PM, Federico Lampis UC3M
<flampis(a)emp.uc3m.es> wrote:
is it possible to use some scalar in the commands of gnuplot? I have in
my funcion a graph and it seems that gnuplot does not allow to put
scalar in the yrange and xrange parameter:
gnuplot lrc lrs otv --with-lines --output=display --single-yaxis { set
title 'Confidence interval for Threshold'; set yrange [0:40]; }
I need that gnuplot uses the maximum and minimum of my series.
If I've understood your request correctly, the following script may help:
<script>
open data4-1
scalar x = max(price)
string foo
sprintf foo "%g", x
gnuplot price sqft {set yrange[0:@foo];} --output=display
</script>
The idea is to write your scalar value into a string, then use the "@"
mechanism for string-substitution inside your gnuplot "literal" block.
Gnuplot (of course) has its own mechanisms for dealing with scalar
variables, but it doesn't know anything about variables defined within
gretl. Hence the detour via strings.
Allin Cottrell