From: Ethan A M. <me...@uw...> - 2020-11-10 21:35:31
|
On Monday, 9 November 2020 15:24:19 PST Tait wrote: > > Datablocks seem like a great way to avoid running slow commands > multiple times, as in: > plot $data using ..., '' using ..., '' using ... > > instead of > plot '<cmd' using ..., '' using ..., '' using ... > > But $data << '<cmd' obviously doesn't work, and the workaround > using load '<cmd' is hard to discover and requires modifying > cmd. Would it be straighttforward to add a way to populate a > datablock from a command the way '<' works for plot and load? Two existing mechanisms come to mind. Neither is a perfect match to what you ask but might serve well enough either as-is or with a straightforward extension. The first is the "volatile" keyword, which tells the program not to reread the data file if the previously read values are still available internally. As of now it is only relevant to "replot", but it might conceivably be extended to cover the use of '' in a plot command. The second works already, subject to some issues like loss of precision and appropriate choice of string formats and/or field separators: set table $DATA plot "< some complicated command" using 1:2:3:4:5:(strcol(6)) with table unset table plot for [i=1:4] $DATA using 1:i with points, \ $DATA using 1:5:6 with labels Does that work for your case? If not, can you suggest ways in which the "with table" might be extended? cheers, Ethan |