Wow, that was a quick! Many thanks to both of you, it works fantastic and I learned
something that will be useful in other context, too.
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] Im
Auftrag von Artur T.
Gesendet: Donnerstag, 21. Januar 2016 14:32
An: gretl-users(a)lists.wfu.edu
Betreff: Re: [Gretl-users] [gnuplot] passing variables as arguments
Hi, replace the numerical values by strings:
<hansl>
nulldata 240
series aa = normal(0,2)
series bb = 2^normal(0,2)
series cc = 3^normal(0,2)
scalar minx = min(bb)<min(cc)?min(bb):min(cc) scalar maxx =
max(bb)>max(cc)?max(bb):max(cc) sprintf strmin "%.4f", minx sprintf strmax
"%.4f", maxx gnuplot aa bb --output="bb.png" { set
xrange[@strmin:@strmax]; } gnuplot aa cc --output="cc.png" { set
xrange[@strmin:@strmax]; } </hansl>
Also, the $-sign is an accessor for internal gretl functions or the loop only.
Best,
Artur
Am 21.01.2016 um 14:22 schrieb Schaff, Frederik:
Hello there,
I'd like to produce a bunch of customised graphs with gretl in a loop, where I fix
the axis ranges depending on values that I calculated beforehand. A minimum (not-) working
example is below.
-------
nulldata 240
series aa = normal(0,2)
series bb = 2^normal(0,2)
series cc = 3^normal(0,2)
scalar minx = min(bb)<min(cc)?min(bb):min(cc) scalar maxx =
max(bb)>max(cc)?max(bb):max(cc) gnuplot aa bb --output="bb.png" { set
xrange[$minx:$maxx]; } gnuplot aa cc --output="cc.png" { set
xrange[$minx:$maxx]; }
------
This does not work because one cannot pass $minx
Is there another way to do so?
Many thanks
Frederik
------------
Frederik Schaff, Dipl.-Volkswirt
University of Hagen
Department of Business and Economics
Chair of Economic Theory (Prof. A. Endres) Universitätsstraße 11 (TGZ)
58097 Hagen
Phone: +49 (0) 2331 987-4454
E-Mail: Frederik.Schaff(a)FernUni-Hagen.de
http://www.fernuni-hagen.de/wirtschaftstheorie/en/team/frederik.schaff
.shtml
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users