I am currently studying the answers to this question about subfigures for use in my writing. The results are impressive especially for the last answer posted for the question. However, I didn't find how the number of rows and columns of the graphs i.e subfigures can be specified. I have tried using "subfig" in the last answer. This works fine. Besides, it automatically arranges the sub-figures. However, when I try to increase the size of the sub-figures, it exceeds the bounds of the page. I hope someone could share how the number of rows and columns for the graphs to be specified, or how the whole figure (including all sub-figures) can be scaled. I didn't repeat the code to avoid monotony and redundancy.
Edit: I include a MWE
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[htb]
\centering
\subfloat[A subfigure]{%
\includegraphics[width=.24\textwidth]{somefig_1}}
\subfloat[A subfigure]{%
\includegraphics[width=.24\textwidth]{somefig_2}}
\subfloat[A subfigure]{%
\includegraphics[width=.24\textwidth]{somefig_3}}
\subfloat[A subfigure]{%
\includegraphics[width=.24\textwidth]{somefig_4}}
\caption{Arranged sub-figures}\label{fig:1}
\end{figure}
\end{document}
Best Answer
The
subcaption
package provides thesubfigure
environment.subfloat
is from thesubfig
package. Try this:As BambOo noted, you can squeeze them a little more if you don't need any horizontal space between the figures by addin
%
s after the\end{subfigure}
and increasing the widths like