> Hi - I am brand new to the use of gnuplot (actually to the whole unix
> environment!). I am attempting to use it to graph a series of 128 lines
> from a data file created in a C program. The file has 40 x values in the
> first column followed by 128 values of y for each x. The values are
> separated by tabs. I have several questions:
> 1) Is there a way to print several of the lines with one command, or must
> each be called from the file separately with "using 1:#"?
> 2) I only seem to be able to get 10 lines to print on one graph window.
> How can I get the colors to repeat when it runs through the list of colors?
> 3) When reading the data file, there seems to be a problem with getting
> a few "extra" points that are not really in the file. I have been unable
> to find any problem with the data file itself, or to locate where in the
> data file the aberrant points come from. Any suggestions?
> Thanks for your help! -- Peggy Shadduck Palombi
First --- get the user's guide "gptug" from picard.tamu.edu/pub/gnuplot
(It's there both in*and PostScript). It's a useful introduction
to gnuplot (he said humbly, being one of the authors...).
Do I understand you that your data file looks like
x(1) y1(1) y2(1) ... y128(1)
x(2) y1(2) y2(2) ... y128(2)
x(3) y1(3) y2(3) ... y128(3)
If so, this is a perfectly reasonable format. Except, if I recall correctly,
there may be some limit in gnuplot 3.5 to the maximum number of columns you
can access... I may be wrong about this :-/ (3.6 doesn't have a limit, as
far as I know.)
gnuplot doesn't have loops, so I can't think of a simple way to plot all
the columns at once. Thus you're stuck with
plot 'file' using 1:2, 'file' using 1:3, 'file' using 1:4, etc
This line will get pretty long if you spell out all 128 columns; 3.6 can
help shorten it a bit by allowing a null file string to mean "use the
previous one". Thus the above line could be written
plot 'file' u 1:2, '' u 1:3, '' u 1:4, etc
where I have also abbreviated "using" (which can be done in 3.5, too).
The colors ought to wrap around automatically if you plot more lines than
you have colors; I don't know the source of that problem. Similarly I can't
say anything about your "extra" points.
You didn't say which version of gnuplot you run... that might make a
If you can't root out the problems yourself, feel free to send me the
data file (assuming it's no bigger than you indicated) and the 'plot'
command(s) you're trying to execute. Perhaps I can say more after seeing