next up previous contents
Next: TeX and LaTeX typesetting Up: No Title Previous: Xterminals

Plotting

The plotting packages currently available on newt are xmgr, sm (written by two astronomers, Robert Lupton and Patricia Monger), gnuplot (the GNU project's excellent package), pgplot (a nice package of FORTRAN callable routines written at Caltech), and Mathematica.

xmgr is excellent for publication quality graphs, and has GUI that makes it easy to use. Documentation for it is available on xmosaic.

sm is command-line driven, and has advantages and disadvantages with respect to xmgr. It supports a number of different graphics devices. If you have an Xterminal, try the following

sm                              ! this starts up sm
Hello Michael, please give me a command
: device x11                    ! select x11 mode           
: box                           ! draw a box on the screen
If you don't have an Xterminal, and do have Tektronix emulating software, then you can use device tek4010 instead of device x11.

Here is a more complex example, directing output to a laser printer (either p206 or the printer defined in the environment variable PRINTER).

sm                              ! this starts up sm
Hello Michael, please give me a command
: device postscript             ! select the Laser printer
: set x = 0, 3.14159, 0.01      ! create an array of x values
: set y = sin(x)                ! find the sine of each x number
: limits x y                    ! choose the limits for the axes
: connect x y                   ! join the dots
: box                           ! plot axes and tick marks
: xlabel angle in radians       ! label the x-axis
: ylabel sin(angle)             ! label the y-axis
: device 0                      ! close the plotfile and send to the printer
: quit                          ! leave SuperMongo
sm is a highly flexible and interactive plotting environment. You can call the sm graphics routines from FORTRAN or C programs. Some documentation is on-line in man sm, and all the commands are described in detail within sm itself (try help within sm). There is also an extensive manual written in TeX and available for photocopying from Michael Ashley.



Michael C. B. Ashley
Fri Jun 28 13:34:23 EST 1996