I am trying to insert four figures in a LaTeX document but if I use subfigure command, two of my figures stay in first row and the other two go to the second line. Like this :
The other solution I tried was using minipage command, but the problem with minipage is that the subfigures get normal figure caption (like Figure 1) while I would like subfigure captions like (a). See the following figure:
What I prefer is to have something like second picture but with the captions like first picture.
Your figures are too wide to fit side-by-side in one line. If multiple subfigures
do not fit in one line, latex does an auto linebreak. You have to specify the width of each included graphic per subfigure
such, that it will sum up to be smaller than the \textwidth
parameter, i.e:
\begin{figure}
\centering
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\caption{(a) blah (b) blah (c) blah (d) blah}
\label{fig:foobar}
\end{figure}
leads to
While if you set the width too high, e.g. width=0.5\textwidth
leads to what I believe is your problem
Although it's been a long time since the question was asked but the solution @gehbiszumeis offered didn't work for me and I still got the normal figure caption for each subfigure. So in case anyone has still the same problem as mine here is what I did (according to this):
\begin{figure}
\centering
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{FIRST IMAGE}
\caption{}
\label{SUBFIGURE LABEL 1}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{SECOND IMAGE}
\caption{}
\label{SUBFIGURE LABEL 2}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{THIRD IMAGE}
\caption{}
\label{SUBFIGURE LABEL 3}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{FOURTH IMAGE}
\caption{}
\label{SUBFIGURE LABEL 4}
\end{subfigure}
\caption{FIGURE CAPTION}
\label{FIGURE LABEL}
\end{figure}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With