|
From: <pl...@pi...> - 2012-05-17 00:03:14
|
On 05/16/12 21:56, Daniel J Sebald wrote: > > Your previous email pointed out a problem with 'datafile' reread on ARM > at a particular instant. There would then need to be something > analogous to '-' and '--' but for data files. OR, the default for > datafiles could be to buffer the data (no easy task given gnuplot wasn't > built that way from the ground up). But if the default for datafiles is > to buffer data, then '--' becomes analogous to 'datafile' as the default > behavior, and '-' becomes the special case. Thanks all. Allin's suggestion would likely be simple to do but could potentially be very wasteful. With the increasing importance of mobile and embedded devices this may not be too desirable As I understand it so far, data for each plot line in read in with a separate reading of the input data source. The points are stored in a slot that enables refresh to do it's job without re-reading the data. It seems it is the calculated plotted points that are stored, not the actual input data. . eg plot datafile using (2*$1:$2/10.) Each plot clause is processed separately and sequentially , hence the need for re-reading the file because the needs of the second plot line are not known on the first reading of the file. I can see how this could have grown out of the constant evolution of features. However, it seems suboptimal for (at least) three reasons: 1. unnecessary re-reading of input file 2. possible plotting of different states of the data in one graph. 3. plot '-' using 1:2 , '' using 1:3 requires two separate datasets (or duplication) to be supplied and thus has different behaviour to a similar command using a data file. Now the obvious technical solution would be to parse the whole plot line to work out what is needed and do it once. This implies some buffering until the actual calculations implied by each 'using' clause get processed. However, the slots about to be attributed. To avoid major restructuring of the code , the data columns needed for all lines could be stored in the slots and processed to actual plotted point data in the usual sequence. All this requires is parsing the whole plot command before the first read of data and allocation of the slots a bit earlier. This would not take any extra storage Again , because plot '-' using is doing something different it will have a different code path but that's already the case. A new plot '--' could provide the same functionality that is available for data files, for pipe input. This would be more consistent and interchangeable. This would make gnuplot behaviour agnostic as to whether the input was a file or a pipe. That is appealing. Pre parsing the plot command would not seem too onerous and , unless I'm wrong about how this is done, it would not seem to involve a paradigm shift in the coding. regards, Peter. |