|
From: Ethan M. <merritt@u.washington.edu> - 2012-01-20 19:32:19
|
On Friday, 20 January 2012, pl...@pi... wrote: > On 01/20/12 18:32, Ethan Merritt wrote: > > On Friday, 20 January 2012, pl...@pi... wrote: > >> Hi, > >> > >> in experiment with new iteration feature I found it does not seem to be > >> applied correctly (ie usefully) to the automatic title in the key > >> > >> > > >> > >> unless I explicitly set a title both plots get an identical entry in the > >> legend : "dataset-".date.".dat" > >> > >> This would seem to render the legend key entries somewhat useless. It > >> also seems illogical that it expands the filename to be plotted but does > >> not expand the entry in the legend. > >> > >> Is this an oversight or am I missing some cunningly useful feature? > > > > I can see arguments either way. > > > > Take the very simple case > > x = 5 > > plot sin(x)/x > > Do you expect the plot key to show "sin(x)/x" or "-0.19178"? > > > > Or, closer to your example, > > Data(year) = "dataset-".date.".dat" > > plot Data(1881) > > Do you expect the plot key to show "dataset-1881.dat" or "Data(1881)"? > > > > > > > >> > >> Best regards, Peter. > > > > Ethan , I don't think you understood what I was reporting. > > None of those examples seems to have anything to do with iteration. Correct. But the behaviour you were reporting is not specific to iteration. The point is that in order to generate the key title, the program takes the expression being plotted as a literal string, _without evaluation_. I gave two examples where this is (I think) the correct thing to do, but I can easily imagine that there are other cases where it is not necessarily the best thing to do. Perhaps being inside an iteration loop is one of these cases. > What I was expecting to see was that the substitution done by for [...] > would be applied to the file name and each file name would be used as > the default title , as is usually the case without iteration. Can you give an example? I can't think of a case where such substitution is done in the case without iteration. E.g. A = "filename.dat" plot A This will use "A" as the plot title, not "filename.dat". Ethan > > > having a legend that looks like: > > "dataset-".date.".dat" > "dataset-".date.".dat" > "dataset-".date.".dat" > "dataset-".date.".dat" > > is certainly of no use , so one is obliged to set it explicitly . > > plot for [date in "1881 1883"] "dataset-".date.".dat" tit > "dataset-".date.".dat" > > No harm done but its a bit messy. > > regards. > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |