5 Figures; Importing Graphics Into Documents

For figures, LaTeX provides the figure environment.


  \begin{figure}
  %
  % Insert figure here
  %
  \caption[List caption]{Text caption}
  \label{fig:example}
  \end{figure}

NOTE: The \label must come after the \caption command.

The graphics/graphicx package allows for inclusion of graphics prepared by other programs. To use it:


  \usepackage[dvips]{graphicx}

Then to insert a graphic, use:


  \includegraphics[options]{file.eps}

Encapsulated PostScript (EPS) is the best graphic format to use.

Programs on mscs that create (Encapsulated) PostScript files:

gnuplotgri
maple matlab
Splus xfig

PS files can be converted to EPS files with the ps2epsi program.


  %!PS-Adobe-2.0
  %%Creator: (ImageMagick)
  %%Title: (ecc_hrt_sk.ps)
  %%CreationDate: (Thu Oct 15 09:03:13 1998)
  %%BoundingBox: 0 0 499 294
  %%LanguageLevel: 2
  %%Orientation: Portrait
  %%PageOrder: Ascend
  . . .

  %!PS-Adobe-2.0 EPSF-1.2
  %%Title: (ecc_hrt_sk.ps)
  %%Creator: (ImageMagick)
  %%CreationDate: (Thu Oct 15 09:05:44 1998)
  %%For: clyde
  %%Pages: 1
  %%DocumentFonts: Helvetica
  %%BoundingBox: 13 7 492 273
  . . .

5.1 Example

Scanned image:

PIC
After using xfig:

PIC
NOTE: Start xfig with

  xfig -specialtext -latexfonts -startlatexFont default

Importing the graphic into a LaTeX file:


  . . .
  \begin{figure}
  %
  \centering
  \includegraphics{pics/cardiac_cell.eps}
  \caption%
  [Structure of internal membrane system of
   mammalian cardiac muscle]
  {Structure of internal membrane system of
   mammalian cardiac muscle,
   illustrating the T-tubules and SR in
   relationship to the myofibrils.
   (From Fawcett and McNutt
   \cite{Fawcett:1969:UCM}.)}
  \label{fig:cardiac_cell}
  %
  \end{figure}
  . . .

Useful options: height, width, keepaspectratio.


  . . .
  \begin{figure}
  %
  \centering
  \includegraphics[heigth=0.5\textheigth,
     width=0.5\textwidth,keepaspectratio]%
     {pics/cardiac_cell.eps}
  \caption%
  [Structure of internal membrane system of
   mammalian cardiac muscle]
  {Structure of internal membrane system of
   mammalian cardiac muscle,
   illustrating the T-tubules and SR in
   relationship to the myofibrils.
   (From Fawcett and McNutt
   \cite{Fawcett:1969:UCM}.)}
  \label{fig:cardiac_cell}
  %
  \end{figure}
  . . .

_______________________________________________________
Last updated: October 27, 2002
Site maintained by: Clyde Clements clyde@mathstat.dal.ca
Return to my home page.