Tested these commands, and the plot works OK, but gretl complaints about it. Appears a warning dialog box that the gnuplot command has failed ("Failed to parse gnuplot file").

If I remove the semi-column in the yrange, there is no warning (but the range is auto).

This is openSuSE 11.3 x64, CVS tested with lang PT and EN.

On Tue, Jun 28, 2011 at 2:45 PM, Cottrell, Allin <cottrell@wfu.edu> wrote:
On Mon, Jun 27, 2011 at 2:55 PM, Federico Lampis UC3M
<flampis@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

_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users