Is there a simple way to plot a datafile which stores data in rows
rather than in columns?
I am sure there is, but I am just learning gnuplot and I can't figure
out an answer from the documentation.
Many thanks!
-- Tony
I'm surprised I didn't find this in the FAQ. The answer is (contrary to
your expectations) no. You'll have to rearrange your data. If you're on
a platform that supports piping (i.e, virtually everything except
Windows), you can do it on the fly. Assuming white-space-separated
data, something like the following should work:
plot "< awk '{for(i=1;i<=NF;i++) print $i}' datafile"
THeo
Thanks for your reply. I am a bit surprised that gnuplot lacks this
capability!
Reformatting the data, as you suggest, will not be a problem.
> I'm surprised I didn't find this in the FAQ.
Is there a mechanism to have it added somehow? It seems like a natural
question.
Thanks again for your help.
Best,
-- Tony
In article <1110384316.7...@l41g2000cwc.googlegroups.com>,
gnuplot is no less immune to creeping featuritis than any other
program, but the underlying philosophy is supposed to be "do one thing,
and do it well". Since text reformatting can be done so well by
external tools, why add it to gnuplot?
That said, it probably would be a relatively simple matter to make the
"record separator" and "field separator" (using awk terminolgy)
completely user-definable, along with a "block separator" and "index
separator", perhaps even in terms of regular expressions. (One can
already define the "field separator" in a limited way using `set
datafile separator`.) As I see it, one could then define the record
separator to be (e.g.) whitespace instead of a newline, allowing a
single row of data to be plotted (although only against record number).
> > I'm surprised I didn't find this in the FAQ.
>
> Is there a mechanism to have it added somehow? It seems like a
natural
> question.
Good question, to which I don't know the answer.
THeo