|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-12 18:08:25
|
On Friday 12 February 2010 09:58:45 Teo S Bernhard wrote: > Problem: > Gnuplot script that set parameter repeatedly in plot command to address the > data index (within a data file) does not work when using gnuplot version > 4.4.0-rc1. > It works in 4.2 version and, from memory, did also work in version 4.3. See > the below shortened example reproducing the error message: > > > # file: trial.gpl > f(x)=x > plot a=1, \ > f(x)*a title "data from index a=1" w l lw 2 lt a , a=a+1, \ > f(x)*a title "data from index a=2" w l lw 2 lt a , a=a+1, \ > a=0 Please see Bug #2907028 https://sourceforge.net/tracker/?func=detail&aid=2907028&group_id=2055&atid=102055 So far as I can tell from running old versions of gnuplot (back to 3.7), it never did work correctly to increment a variable multiple times inside a plot command. The good news is that in version 4.4 you can do this easily using the construct plot for [a=1:2] f(x)*a title "data from index a=1" w l lw 2 lt a > pause -1 "Continue?" > > # > # gnuplot 4.2 patchlevel 5 accepts the above. I believe that also > # gnuplot 4.3 accepted this. > # > # gnuplot-4.4.0 patchlevel 0-rc1 give error: > # "trial.gpl", line 6: function to plot expected > # > # > # It works if I add a dummy curve after a=0, so that last line > # becomes: > # a=0, x/0 > # > exit > > Best regards > Teo > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |