|
From: Ethan A M. <sf...@us...> - 2012-05-17 19:28:12
|
On Wednesday, May 16, 2012 04:41:25 pm Allin Cottrell wrote:
> I'm envisaging, say,
>
> m = {1,2,3; 4,5,6; 7,8,9}
>
> where (just for illustration) I'm assuming a matrix syntax in which
> ',' is the column separator and ';' is the row separator.
Only numerical data?
That really seems like it's a separate request - to support numerical
arrays as a variable type. In certain cases it might substitute for
a mechanism of caching the input stream, but it would be less general.
And, as I noted before, people would immediate start requesting
support for inv(m) and det(m) and m2 = m * m and so on.
My inclination is to think about caching multiline character input
rather than numerical arrays. Somewhat along the lines of the patch
that Dan Sebald mentioned, although as I recall that dealt with caching
input from a normal data file rather than offering a new mechanism
of providing data in-line.
Something like
gnuplot> store DATA1 <<EOF
Paris France 2110420 48.86° 2.34°
Marseille France 820729 43.31° 5.37°
Lyon France 443859 45.76° 4.83°
Toulouse France 411768 43.62° 1.45°
EOF
gnuplot> plot DATA1 using 5:4:($3 < 5000 ? "-" : strcol(1) with labels
Questions
- Would we need sanity checks limiting the size (number of lines?) of
the in-line data?
- How persistant would DATA1 be? Would we require an explicit command
to discard it and free the memory?
- Would all the existing "set datafile" options apply to this in-line
input also, or would it get a separate set of options?
[aside] It's really hard to type <tab> characters into the gnuplot
input stream, because readline grabs them. So tab-separated data
fields could be a problem.
- What about binary data?
- Would the stored data act as a normal string for the purpose of
string operations?
- What about the keyword "every"?
> > 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
>
> OK, I see what you mean, but please note that I'm _not_ requesting
> that "calculations can be done with the [matrix] data". That, it
> seems to me, is not gnuplot's job.
>
> > I'd like to see a more fully-developed proposal before seriously
> > considering it.
>
> Or a patch; I'm not just requesting that someone else does this for
> me.
>
> > 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.
>
> FWIW you'd have my full support in resisting that sort of bloat. All
> I'm interested in is a more efficient way to "inline" plottable data
> in a gnuplot command file.
>
> Allin Cottrell
|