Next: C.3.2 GMT graphics in Up: C.3 Examples Previous: C.3 Examples Contents Index

## C.3.1 GMT graphics in LATEX

Nearly all illustrations in this GMT documentation were GMT-produced PostScript files. They were converted to PDF files using ps2raster and then included into a LATEX document that was processed with pdflatex to create the PDF document you are reading.

To add the graphics into the LATEX document we use the `\includegraphics` command supplied by the graphicx package. In the preamble of your LATEX document you will need to include the line

    \usepackage{graphicx}

The inclusion of the graphics will probably be inside a floating figure environment; something like this

    \begin{figure}
       \includegraphics{myplot}
       \caption{This is my first plot in \LaTeX.}
       \label{fig:myplot}
    \end{figure}

Note that the `\includegraphics` command does not require you to add the suffix `.pdf` to the file name. If you run pdflatex, it will look automatically for myplot.pdf. If you run latex, it will use myplot.eps instead.

You can scale your plot using the options `width=`, `height=`, or `scale=`. In addition, if your original graphics was produced in Landscape mode (i.e., you did not use GMT's -P option: not while plotting, nor in ps2raster), you will need to rotate the plot as well. For example,

    \includegraphics[angle=-90,width=0.8\textwidth]{myplot}

will rotate the image 90° clockwise and scale it such that its width (after rotation) will be 80% of the width of the text column.

Next: C.3.2 GMT graphics in Up: C.3 Examples Previous: C.3 Examples Contents Index