The l2h help pages   © Leon van Dommelen 
The latest version of this document is online at eng.fsu.edu or at dommelen.net.

Creating plots

In a scientific paper, you normally will need to include various plots. The preferred format of plot files is .eps, (Encapsulated PostScript.) At least that is the preferred format as far as l2h is concerned. There are various ways to make the plots. This web page will summarize three, but concentrate on gnuplot.

Contents
Your favorite commercial plot program
Matlab or Octave
Gnuplot

Your favorite commercial plot program

Most plot programs have some option to save files as plots in .eps format. If you already know how to use this program, this would obviously be the way to go. Unfortunately, many such programs create faulty .eps files. They may have the plot outside of the printed page. Complain; you paid for it. (A free utility, ps2eps, can often fix up faulty eps files. Try options ps2eps --loose --warning --ignoreBB.)

If your program does not seem to have an option to save to eps, there is a dirty trick that may work. Use the Print menu, in it "print" to a file (instead of a printer), and select a Postscript printer driver to do it.

Matlab or Octave

The commercial Matlab program and its free clone Octave can save files in .eps format. Furthermore, they are fairly easy to learn if you are satisfied with the default settings. (I do find that I really have to struggle to get full control of the plot format.)

Matlab you have to buy, Octave is free. If you are using linux, your package manager can probably install octave. Otherwise go to http://www.gnu.org/software/octave/

Gnuplot

Gnuplot is my preferred plotting software. It is free. If you are using linux, your package manager can probably install gnuplot. Otherwise go to http://www.gnuplot.info/.

You will however want some help to get started. Piecing things together from the manual would be time-consuming, even if there is an index, nowadays. Therefore below a number of sample gnuplot scripts are provided that do basic tasks:

  1. curves.txt will make the normal, "xy"-type, plots of curves.
  2. contour.txt will make contour lines, (The isobars in weather maps are an example of contour lines.)
  3. color.txt will show levels of a quantity as colors. (This is really a more colorfull way to show contour lines.)
  4. 3d.txt will make three-dimensional graphs of a function depending on two variables.
Read the comments in these scripts to find out how to use them and how to adapt them to your needs. You also need the symbol font cmmi10.pfa for mathematical letters and symbols. Put it in the folder with your plot files.

To try out the scripts above, you will also want the sample data files goertler.plt, veloc.plt, accel.plt, and meas.plt. You can look at these files with a text editor; they are plain text. They show the format you need to put your data in to plot them using gnuplot. (The Fortran program used to create these sample data files is curves.f.)

Further examples based on these files can be found in the "plots" subfolder of the example folder in l2h.

And for more sophisticated use, you will definitely want to look at the gnuplot manual. (See gnuplot.html for a backup copy of version 4.4). And you will want the documentation on the postscript driver, being ps_guide.pdf, ps_symbols.pdf, and ps_fontfile_doc.pdf. They tell you how to produce subscripts and superscripts and such, how the various symbol and line types look, and what character number is what mathematical character.

 Index   Intro to LaTeX