Re: Commands into datablocks

Ethan A Merritt <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.devel
Organization University of Washington
Message-ID <2098420.pU8yO8A8EX@stonelion>
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






_______________________________________________
gnuplot-beta mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.