4

I cannot place my plot centered on the page. I tried the following code:

\begin{figure}[ht]
\begin{center}
\begin{minipage}{\columnwidth}
\includegraphics[width=5in]{plot1.pdf}
\end{minipage}
\begin{minipage}{\columnwidth}
\includegraphics[width=5in]{plot2.pdf}
\end{minipage}
\begin{minipage}{\columnwidth}
\includegraphics[width=5in]{plot3.pdf}
\end{minipage}
\caption{xxx} 
\end{center}
\end{figure}

enter image description here

As one can recognize, the plot is not centered. Waht should I do to get it centered?

  • 3
    Remove the minipages. – Ulrike Fischer Apr 16 '14 at 12:27
  • How should I then make then one Graph? – DatamineR Apr 16 '14 at 12:29
  • You can use the subcaption package which introduces a subfigure environment. – Trefex Apr 16 '14 at 12:34
  • To answer the question "how should I them make them one graph", a variation on \includegraphics[width=5in]{plot1.pdf}\\ \includegraphics[width=5in]{plot2.pdf}\\ \includegraphics[width=5in]{plot3.pdf} should suffice. The other issue is whether your figure sizes are larger than the margin widths. Without a full working example, it is hard to tell. – Steven B. Segletes Apr 16 '14 at 12:37
  • 1
    The minipages are useless. They don't do anything in your code. Simply add an empty line between the graphics or \\ to get them one under the other. – Ulrike Fischer Apr 16 '14 at 12:38
6

The comments above tell you what to do, the reason that what you did did not do anything is that you were centering the minipages but they were full width already so centering (or flush left or right) does nothing as a full width box is already "centred".

Within the minipage the settings are restored closer to default page settings, so if you want to centre the image inside a minipage the \centering command needs to be inside each minipage. But here, you can simply delete the minipages and allow the outer \centering to affect the included graphics directly.

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.