gnuplot problem

gnuplot problem

Post by Peggy Palom » Sat, 11 May 1996 04:00:00



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

 
 
 

gnuplot problem

Post by crawford richa » Sat, 11 May 1996 04:00:00



> 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)
etc

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
difference.

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
those.

Good luck,



 
 
 

1. Gnuplot mailing list, gnuplot problem.....

If the problem is one of insufficient space in storing the input command, you
might look in the  plot.h  file, at line 65 (at least that's where this is
in the  plot.h  file here for Gnuplot 3.0):

#define MAX_LINE_LEN 1024       /* maximum number of chars allowed on line */
#define MAX_TOKENS 200
#define MAX_ID_LEN 50           /* max length of an identifier */

#define MAX_AT_LEN 150          /* max number of entries in action table */

Try upping the value of one or more of the above constants, then re-compiling.

Hope this helps!

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|  David Douglas                              |
|  Graduate Computer Science program          |
|  University of South Carolina               |
|  Columbia, S.C.  29208                      |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2. Arabic Font - Where can I download?

3. more gnuplot problems

4. TIFF 6.0 RGBA format ????

5. mouse and pipe-controlled gnuplot problems

6. 3D trees for a real look

7. gnuplot (problems)

8. Gnuplot problem in Linux

9. gnuplot problem

10. latex-gnuplot problem

11. A little GNUPlot problem..