next up previous contents index
Next: Mtos Up: Mp Previous: Mp   Contents   Index


Metapost Instructions

- Set your terminal to Metapost, e.g.:

  set terminal mp mono "cmtt12" 12

- Select an output-file, e.g.:

  set output "figure.mp"

- Create your pictures. Each plot (or multiplot group) will generate a separate Metapost beginfig...endfig group. Its default size will be 5 by 3 inches. You can change the size by saying set size 0.5,0.5 or whatever fraction of the default size you want to have.

- Quit gnuplot.

- Generate EPS files by running Metapost on the output of gnuplot:

  mpost figure.mp  OR  mp figure.mp

The name of the Metapost program depends on the system, typically mpost for a Unix machine and mp on many others. Metapost will generate one EPS file for each picture.

- To include your pictures in your document you can use the graphics package in LaTeX or epsf.tex in plainTeX:

  \usepackage{graphics} % LaTeX
  \input epsf.tex       % plainTeX

If you use a driver other than dvips for converting TeX DVI output to PS, you may need to add the following line in your LaTeX document:
  \DeclareGraphicsRule{*}{eps}{*}{}

Each picture you made is in a separate file. The first picture is in, e.g., figure.0, the second in figure.1, and so on.... To place the third picture in your document, for example, all you have to do is:
  \includegraphics{figure.2} % LaTeX
  \epsfbox{figure.2}         % plainTeX

The advantage, if any, of the mp terminal over a postscript terminal is editable output. Considerable effort went into making this output as clean as possible. For those knowledgeable in the Metapost language, the default line types and colors can be changed by editing the arrays lt[] and col[]. The choice of solid vs dashed lines, and color vs black lines can be change by changing the values assigned to the booleans dashedlines and colorlines. If the default tex option was in effect, global changes to the text of labels can be achieved by editing the vebatimtex...etex block. In particular, a LaTeX preamble can be added if desired, and then LaTeX's built-in size changing commands can be used for maximum flexibility. Be sure to set the appropriate MP configuration variable to force Metapost to run LaTeX instead of plainTeX.


next up previous contents index
Next: Mtos Up: Mp Previous: Mp   Contents   Index
Ethan Merritt 2007-03-03