New York University
NYU
PHYSICS
DEPARTMENT
PEOPLE
RESEARCH
EVENTS
COURSES
RESOURCES
Graduate School of Arts and Science
GSAS
College of Arts and Science
CAS

The quick way to plot from x-y data file on scires

P H Y S I C S

Suppose you have an x-y data file which contains following lines (The space between columns can be any number of blanks or tabs ):

0.0  0.0
1.0  0.2
2.0  0.0
3.0  0.4
4.0  0.2
5.0  0.6
There are many ways to plot from the file. One of them is graph.

If you have X-Windows, type

graph -TX file_name
to view the plot.

If you do not have X-Windows, but you want to print it out, type

graph -Tps file_name | lpr -Pprinter_name
or
graph -Tps file_name > PS_file_name

Here is the plot from the test data with following command (save the data as file test.dat):

graph -TX test.dat

result of the test data

Here is plot with more options:

graph -TX -X "x" -Y "y" -L "Test" -C -m 3 -S 6 test.dat   

result of the test data with options

Or you can have more options

graph -TX -x -4.2 4.2 -y -0.62 0.62 -X "x" -Y "y" -L "Test" -C -m 1 -S 2 -g 4 test.dat 

result of the test data with more options

That's all, folks. Go to the manual to learn more.


Revised: Mon Oct 9 13:44:39 2000
webmaster@physics.nyu.edu
© 1999 Physics Department, New York University. All rights reserved.