I'm using the subfig
package to arrange multiple graphics inside a figure. I'm trying to arrange two graphics vertically inside a subfloat but keep getting an error. I'd like the figures to be arranged something like this:
_____ _____
|_____| | |
_____ | |
|_____| |_____|
(a) (b)
But when I try
\begin{figure}
\centering
\subfloat[][]{
\includegraphics{graph1} \\
\includegraphics{graph2}
}
\subfloat[][]{
\includegraphics{graph3}
}
\end{figure}
I get the error Something's wrong--perhaps a missing \item
. If I remove the linebreak inside the subfloat the error goes away but then my figures aren't arranged right. How should I be doing this?
Best Answer
Here's one option using the
subfigure
environment from thesubcaption
package and taking advantage of the optional arguments for the environment (the same as those for aminipage
); depending on the actual size of your images, you might need to adjust some lengths: :The
demo
option forgraphicx
simply replaces actual figures with black rectangles; do not use that option in your actual document.And here's an option using the
subfig
package and someminipage
s:You can box the larger image and measure its height to use this value for the minipages height. The mechanism is explained in Aligning 3 images square in a box