From: <pl...@pi...> - 2012-05-14 15:19:52
|
On 05/14/12 14:52, Allin Cottrell wrote: > On Mon, 14 May 2012, Mojca Miklavec wrote: > >> On Mon, May 14, 2012 at 8:21 AM, <pl...@pi...> wrote: >>> HI, >>> >>> I am plotting some data from a data file with four columns to produce >>> three plot lines. >>> >>> set timefmt "%d.%m.%y:%H:%M"; set xdata time >>> plot "fast.log" using 1:2 t "systolic" w l, "fast.log" using 1:3 t >>> "diastolic" w l, "fast.log" using 1:4 t "pulse" w l >>> >>> To save having a separate gnuplot script file I was trying to put these >>> two lines at the head of the data and use the plot '-' feature. But this >>> involves reading the data three times and I can't see how to do it. >>> >>> Before suggesting ways this could be improved I was wondering whether I >>> was missing a trick. >> >> Simply use empty quotation marks: >> plot "fast.log" using 1:2 t "systolic" w l, "" using ... > > This doesn't work in the context plotter specified, namely when you > replace the data file "fast.log" with inline data in the plot file, > using "plot '-'". > > I too would be interested to know if there's any way to avoid repeating > the inline data when plotting multiple lines. > > Allin Cottrell Thanks Allin, unless someone points out a trick we're missing perhaps the plot '-' feature could be extended to act in same way as a named file. It seems that plot '-', '-' already has a defined behaviour of reading two subsequent sets of inline data so I guess that has to stay as it is. This seems to be the effect of using plot "" after plot '-' too. This an unfortunate asymmetry in the behaviour when compared to named files but it's long established and probably should stay as it is. So could another flag like plot '--' be used to indicate rereading of the inline data rather than continuing at the next block of inline data ? regards, Peter. |