n article < XXXX@XXXXX.COM >,
E.D.G. < XXXX@XXXXX.COM > wrote:
If you have not looked at Octave, you probably should. It manages to drive
gnuplot even under Windows, and whatever tricks they used may be directly
relevant to your application as well.
Sorry, I don't follow what you mean by that. In particular I don't follow
what you mean "erased by the last replot command".
Replot does exactly what it sounds like; it re-executes the previous plot
command. You may have changed something in between (view angle, labels,
axis range, position on the canvas, etc). If so, the new plot may overlap
the old one, or sit beside it, or whatever. If you want the lines from the
previous plot to remain, the you tell gnuplot to use "multiplot" mode.
The recent change is to offer an alternative "refresh" command, which does the
same thing but without re-reading the underlying data. This allows it to work
through a pipe, and is needed by recent versions of Octave. It is also
relevant if you are plotting realtime data, where the data may have changed
since the previous plot command. "replot" would use the new data, since
reading from the data source was inherent in the previous command;
"refresh" instead skips this part and re-uses the old data.
[yeah, that may sounds backwards, but the behaviour of "replot" was already
OK, but that could still be programmed in gnuplot itself using the
"bind" command to reassign the meaning of keypress events. I don't know
whether that would result in faster response than doing it at the perl
layer, but you might want to experiment.
I don't know about "easier", since I don't know in detail what your
application needs to do. But you also mentioned a constraint on speed,
and I rather suspect it's faster to use gnuplot built-in operations when
they are available rather than emulating them in the perl layer.
Ethan A Merritt