Ian Chivers wrote:
>>i was therfore going to break things down into
>>
>>1. simple graphics programming using a library
>>for doing plots, maps etc.
I'll suggest including another section
0. graphics outside Fortran.
Although it really doesn't have anything to do with Fortran, many
people looking for simple plotting haven't even thought of the
possibility of using Fortran just to write the numbers and using
a plotting application afterwards. Perhaps because graphics and
computer language are inseparably tied in many environments
(Java, Maple, Windows programming, old BASIC, etc..)
People seem to ask the question "how do you do graphics in Fortran"
even when they don't really need interactive graphics so there
really isn't a need to put graphics inside the program.
Of course, this section can't be anywhere near an exhaustive list
because anything that can read a text file and plot can belong
to this section. A description of one or two plotting tools to
illustrate the concept, and perhaps a list of just the names of
some of the more often used tools (so they can be googled) would
be enough. Here's a description of my favorite tool:
gnuplot
-------
Gnuplot is a portable command-line driven data and function
plotting utility. Supports many types of plots in either 2D and 3D.
It can draw using lines, points, boxes, contours, vector fields,
surfaces, and various associated text.
http://www.gnuplot.info/
(See site for examples)
Gnuplot can take simple structured blank-delimited columns and rows
of numbers as input, and can output figures on the screen or save
them in some format (e.g. postscript).
For example, 3D data suitable for gnuplot can be written within a
Fortran program
do j = 1, nj
do i = 1, ni
write(22,"(3es16.7)") x(i), y(j), dat(i,j)
end do
write(22,"()") ! blank line delimits rows in 3D plots
end do
and after the Fortran program execution ends, plotted within gnuplot
gnuplot> splot "datafile"
(assuming unit 22 in the Fortran code snippet writes to the file
"datafile").
There is also PLUS-enhanced gnuplot, based on an older version of
gnuplot, that conveniently enables LaTeX style math expressions
in postscript figures:
http://www.yama-ga.com/gnuplot/
--
Yasuki Arasaki
[log in to unmask]
|