From: Ethan A M. <sf...@us...> - 2012-05-14 16:28:29
|
On Monday, May 14, 2012 08:12:25 am pl...@pi... wrote: > On 05/14/12 14:52, Allin Cottrell wrote: > > On Mon, 14 May 2012, Mojca Miklavec wrote: > > > >> 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 _does_ act in the same way as a named file. The empty quotes indicate that the previous source of data should be read again. > 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. Yes. "" means "read the same input source again". > 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 ? This wouldn't work in the general case - you can't reread from a pipe. The next obvious thought is "can't we remember the values we just read and re-use them if necessary?". But that doesn't work either. Consider: plot '-' using 1:2, '' using 3:4, '' using 99:100 The first plot uses only columns 1 and 2; these values are stored internally and could be used again without rereading. That's what the "refresh" command does. But the 2nd and 3rd plots use data values from columns we didn't use the first time and hence didn't keep. So those values can only be recovered by rereading. The closest I can think of still requires the use of a temporary file. The script would do: set print "tempfile.dat' print "first data line" print "second data line" ... print "last data line" plot 'tempfile.dat' using 1:2, '' using 3:4, '' using 99:100 |