[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting Data




  Create a text file called "test.dat" with several columns:

1 1  1
2 4  0
3 6  -1
4 7  0
5 10 1
6 12 0
7 13 -1

  Run 'gnuplot'.  At the "gnuplot>" prompt, type

gnuplot> plot 'test.dat' using 1:2

  A window will pop up with a graph showing data from column 2 on the y-axis,
column 1 on the x-axis.  The graph will autoscale to fit the data.

gnuplot> plot [0:10][0:20] 'test.dat' using 1:2

  will show the same data, but now with limits 0 to 10 on the x-axis,
0 to 20 on the y-axis.

  If you want to plot several quantities on the same graph,

gnuplot>  plot 'test.dat' using 1:2, 'test.dat' using 1:3

  will make a single graph which shows both column 2 plotted against col 1,
and column 3 plotted against col 1.  The graph will be autoscaled to fit
all the data, by default.

  If you want to make a nice graph with labels, use "set xlabel"
and "set title".  

  For more information, read 

 FAQ:       http://www.ucc.ie/gnuplot/gnuplot-faq.html
 manual:    http://www.comnets.rwth-aachen.de/doc/gnu/gnuplot37/gnuplot.html
 intro:     http://www.cs.uni.edu/Help/gnuplot/

  Good luck.

                                     Michael Richmond