1

I want to have 4 figures side by side and centered in my paper. I am using this code. The problem is that captions and figures are not aligned. It seems captions are in correct position, but figures are not and directed to right side. Captions are not below of the figures. I am using a double-column format.

\begin{figure*}[ht]
\centering
\begin{tabular}{cccc}
\begin{minipage}{115pt}
\centering
\includegraphics[width=180pt]{1.pdf}
\vspace{-75pt}
\caption{aaaa}
\end{minipage}
&
\begin{minipage}{115pt}
\centering
\includegraphics[width=180pt]{2.pdf}
\vspace{-75pt}
\caption{bbbb}
\end{minipage}
&
\begin{minipage}{115pt}
\centering
\includegraphics[width=180pt]{3.pdf}
\vspace{-75pt}
\caption{cccc}
\end{minipage}
&
\begin{minipage}{120pt}
\centering
\includegraphics[width=180pt]{4.pdf}
\vspace{-75pt}
\caption{dddd}
\end{minipage}
\end{tabular}
\end{figure*}
  • The need for a negative \vspace suggests that your images have white borders around them. – egreg Feb 14 '13 at 23:23
  • if you put a 180pt wide figure into a 115pt minipage the \centering will have no effect and the figure will be an overfull box sticking out on the right. – David Carlisle Feb 14 '13 at 23:29
  • 1
    Why not trying the subcaption package that would handle spacing for you ? – Uneo Feb 15 '13 at 6:03
  • There's a lot of repetition in your code. You should consider defining a single macro to automate the task of inserting the minipages. – user10274 Feb 15 '13 at 7:48
2

Doing figures next to each other is easier with the subfig environment. Like Uneo suggests, load the subcaption package. The code you are looking for is probably something like this:

\begin{figure}
        \centering
        \begin{subfigure}[b]{0.25\textwidth}
                \centering
                \includegraphics[width=180pt]{1.pdf}
                \caption{aaa}
                \label{fig:a}
        \end{subfigure}
        %add/remove whitelines for spacing between pictures

        \begin{subfigure}[b]{0.25\textwidth}
                \centering
                \includegraphics[width=180pt]{2.pdf}
                \caption{bbbb}
                \label{fig:b}
        \end{subfigure}

        \begin{subfigure}[b]{0.25\textwidth}
                \centering
                \includegraphics[width=180pt]{3.pdf}
                \caption{ccc}
                \label{fig:c}
        \end{subfigure}

        \begin{subfigure}[b]{0.25\textwidth}
                \centering
                \includegraphics[width=180pt]{4.pdf}
                \caption{ddd}
                \label{fig:d}
        \end{subfigure}
        \caption{zzzzz}\label{fig:z}
\end{figure}

This is an adaptation from the example in the wikibook here. You will have to play around with the width of the images and the figures to get everything in the right position, but without the actual images thats not possible for me.

The example uses the packages graphicx, caption and subcaption.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.