Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to add subfigures using subfigure package

📅 2014-Jul-09 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Multiple figures are sometimes arranged together in a single figure in a paper or book written in LaTeX. This can be done using subfig and subfloat packages. I recently discovered the subfigure package which can be used to achieve the same with less code!

Below is LaTeX code to arrange three subfigures in two rows, one figure in top row and two figures in bottom row:

% Arrange three figures like this:
%     Fig 1
% Fig 2  Fig 3

\begin{figure}
    \centering
    \subfigure[]
    {
        \includegraphics[scale=.2]{foo1.pdf}
    }
    \\
    \subfigure[]
    {
        \includegraphics[scale=.5]{foo2.pdf}
    }
    \qquad
    \subfigure[]
    {
        \includegraphics[scale=.26]{foo3.pdf}
    }
    \caption
    {
        (a) blah
        (b) blah
        (c) blah
    }
    \label{fig:foobar}
\end{figure}

Tried with: Ubuntu 14.04