Package subfigure – Deprecated: Figures divided into subfigures
The package is now considered obsolete: it was superseded by subfig, but users may find the more recent subcaption package more satisfactory.
The optional argument for the subfigure environment provides the placement of the sub-caption anchor. This is used to align the sub-captions vertically.
\begin{figure} \centering \texttt{subfigure} with \texttt{[t]}op alignment
\medskip
\begin{subfigure}[t]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure} \begin{subfigure}[t]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure} \begin{subfigure}[t]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-c} \caption{This is a sub-caption. This is a sub-caption.} \end{subfigure}
\bigskip\hrulefill\bigskip
\texttt{subfigure} with \texttt{[c]}entre alignment (default)
\medskip
\begin{subfigure}{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure} \begin{subfigure}{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure} \begin{subfigure}{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-c} \caption{This is a sub-caption. This is a sub-caption.} \end{subfigure}
\bigskip\hrulefill\bigskip
\texttt{subfigure} with \texttt{[b]}ottom alignment
\medskip
\begin{subfigure}[b]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure} \begin{subfigure}[b]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure} \begin{subfigure}[b]{.3\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-c} \caption{This is a sub-caption. This is a sub-caption.} \end{subfigure} \end{figure}
\begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth,height=75pt]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\qquad \begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth,height=5pc]{example-image-b} \caption{This is a sub-caption.} \end{subfigure}
\bigskip\hrulefill\bigskip
\verb|\raisebox| to vertical top
\medskip
% Store largest image in a box \savebox{\imagebox}{ \includegraphics[width=.2\linewidth,height=75pt]{example-image-a} }%
\begin{subfigure}[t]{.4\linewidth} \centering\usebox{\imagebox} % Place largest image \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\qquad \begin{subfigure}[t]{.4\linewidth} \centering\raisebox{\dimexpr\ht\imagebox-\height}{% Raise smaller image into place \includegraphics[width=.5\linewidth,height=5pc]{example-image-b}}% \caption{This is a sub-caption.} \end{subfigure}
\bigskip\hrulefill\bigskip
\verb|\raisebox| to vertical centre
\medskip
% Store largest image in a box \savebox{\imagebox}{ \includegraphics[width=.2\linewidth,height=75pt]{example-image-a} }%
\begin{subfigure}[t]{.4\linewidth} \centering\usebox{\imagebox}% Place largest image \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\qquad \begin{subfigure}[t]{.4\linewidth} \centering\raisebox{\dimexpr.5\ht\imagebox-.5\height}{% Raise smaller image into place \includegraphics[width=.5\linewidth,height=5pc]{example-image-b}}% \caption{This is a sub-caption.} \end{subfigure}
\usepackage{graphicx,subcaption} \usepackage[margin=1cm,showframe]{geometry}% Just for this example
\begin{document}
\begin{figure} \centering
Fixed separation using \verb|\quad| (or \verb|\qquad|, or \verb|\hspace|)
\medskip
\begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\quad \begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure}
\bigskip\hrulefill\bigskip
Even spread via \verb|\hfill|
\medskip
\mbox{}\hfill \begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\hfill \begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure} \hfill\mbox{}
\bigskip\hrulefill\bigskip
Full spread via \verb|\hfill|
\medskip
\begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-a} \caption{This is a sub-caption. This is a sub-caption. This is a sub-caption} \end{subfigure}\hfill \begin{subfigure}[t]{.4\linewidth} \centering\includegraphics[width=.5\linewidth]{example-image-b} \caption{This is a sub-caption.} \end{subfigure}