next up previous

2D Curves

The following short Fortran source code shows how to write a very simple file, 2dcurve.dat in the MTV format, plotting a parabola.

       program twodcurve


       do 10 i = -10,10
       x = real(i)
       y = x*x
10     continue


First, compile and execute the above program twodcurve to create the data file 2dcurve.dat. To begin using plotmtv, login or telnet to a machine on which plotmtv has been installed. Check with your system administrator on this. If you are running plotmtv from a remote machine, execute the xhost command on your local workstation to allow the remote machine to write to your local screen. The syntax is

Then, tell the remote machine where to display the graphics you will be creating . For the C shell, this requires executing, on the remote machine, the command

At this point, you can use plotmtv to view the data in the file 2dcurve.dat by typing

To make it a little more interesting, you can add some of the command options to the "plotmtv" command, such as to get the following results: