From: Allin C. <cot...@wf...> - 2012-05-14 17:14:16
|
On Mon, 14 May 2012, Ethan A Merritt wrote: > 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. [...] >> >> 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. With the source in this case being stdin, which has "moved on" by the time you attempt a second read, so you come up empty-handed. I see your point. On the other hand, with the plot-file syntax plot '-' using ... <inline-data> e it's sort of a fiction that the source is stdin, isn't it? (Albeit a well established fiction.) I wonder if it would be worth adding another "dummy" input, something like plot inline using ... <inline-data> e where the inline data would be read into an array and could be reused at will. > 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 Ah, that's clever. Not quite as nice as "inline" (if it were possible) but it serves the purpose of storing the data and the plot spec in a single file. Allin Cottrell |