|
From: Ethan A M. <sf...@us...> - 2012-05-16 21:08:01
|
On Wednesday, May 16, 2012 01:17:22 pm Allin Cottrell wrote:
> >> Just a notion, but what if gnuplot's syntax permitted defining a matrix
> >> (either "inline" with some nice, simple syntax or by reading from a
> >> file), and you could then say something like
> >>
> >> plot matrix "foo" using ...
> >>
> >> as many times as you wanted, using whichever columns?
>
> The way I'm thinking about this, no look-ahead is needed. All
> gnuplot has to do is store the given matrix (all of it), then draw
> on it as and when specified.
There is a significant subset of gnuplot users for whom it is a key
feature that gnuplot can handle large data sets. Here "large"
means millions of points. It can do this exactly because it does
not store the entire contents of the data file prior to processing.
This makes it very different from alternative programs such as
R, which do not handle such large data sets gracefully, if at all.
Clearly there are benefits on both sides, but up until now we have
considered it a priority to minimize internal data storage.
> I'm mooting this as an extension of the way that gnuplot can
> currently store scalars (and complex numbers) for future use,
> without having any idea at the time what they'll be used for.
Sorry, you lost me there. What are you refering to?
We don't currently have a generic method for reading in and storing
scalars either. You can sort of fake it using commands like
foo = int(system("cat data-file-containing-a-number"))
but that is really ugly.
> This strikes me as a lot more straightforward than messing with the
> way datafiles and stdin currently work.
It's been suggested before. For example, Feature Request #1957568
https://sourceforge.net/tracker/index.php?func=detail&aid=1957568&group_id=2055&atid=352055
I'd like to see a more fully-developed proposal before seriously
considering it. It's not just a question of making up some syntax for
plot commands; that's the easy part. You can bet that the moment we
provided a way to read in a matrix, people would start clamoring for
math library support to do matrix operations.
Of course, it might have the advantage of replacing a lot of very
messy code that currently handles ascii and binary "matrix" data
during plotting. It might turn out to be simpler overall to separate
the operation into two steps: 1) read in the matrix data 2) plot it.
Or maybe not. I'm reasonably happy with the way "with image" works now.
But I'm less happy that the interpretation and handling for matrix
data currently differs depending on whether the input was ascii or binary.
Ethan
|