2. Curves in 3-Space
The following short Fortran source code shows how to write a very simple file,
helix.dat, in the MTV format.
c Specify that data is to be a 3d curve
t = 0.0
do 1 m = 0,mmax
x = cos(t)
y = sin(t)
z = 0.1*t
t = t + dt
First, compile and execute the above program helix to create the data file helix.dat.
To begin using plotmtv, rlogin 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
For the C shell this requires executing, on the remote machine, the command
xhost [ [+-] hostname...].
At this point, you can use plotmtv to view the data in the file helix.dat by typing
setenv DISPLAY your_local_hostname:0
after which (with a left click on the 2D/3D option) a window similar to
Figure 1 should
Click here to have
plotmtv plot the helix.
Figure 1 was constructed with command line options -pfg BLACK -pbg WHITE
to set the foreground and background colors to prevent using a lot of toner when printing
this document, so your default plotmtv plot will have different colors. Experiment with
rotating the plot of the helix and tipping it forward and backward.
Figure 1 Plot of MTV file helix.dat