[Tex/LaTex] Getting two pictures to appear on the same page

floatssubfloats

I have two images that I would like to appear on the same page. Each figure should appear as a separate figure with its own caption.

My problem is that LaTeX sometimes places the figures on separate pages.

I currently have achieved this by putting two \psfragfig commands consecutively within the same figure environment. This seems a simple and succesful approach, but I wonder if I am not using the figure environment correctly by doing this. Should I use the subcaption package instead?

Best Answer

You are using the figure environment correctly. The environment is merely a floating shell that primarily contains figure-related content. Sure you can put a table inside of it, but most people include an image and some text (in the form of a caption). If you include more than one, it's just the same:

\begin{figure}[ht]
  \centering
  \includegraphics[<options>]{<image1>}
  \caption{<caption1>}

  \vspace*{\floatsep}% https://tex.stackexchange.com/q/26521/5764

  \includegraphics[<options>]{<image2>}
  \caption{<caption2>}
\end{figure}

The gap between consecutive floats is given by \floatsep.

One would only use \subcaption if you have the same main content you want to illustrate, but the two figure resemble slight variations of one another. So, they should fit under/above the same heading (\caption), but each with a sub-numbering (\subcaption).