How to align multiple subfigures in a grid?
You are already using the subcaption
package, and it is very easy with it.
Here's the code you need
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{A mouse}\label{fig:mouse}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{A gull}\label{fig:gull}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\caption{A tiger}\label{fig:tiger}
\end{subfigure}
\caption{Picture of animals}
\label{fig:animals}
\end{figure}
\end{document}
Output:
If you need to have the subcaption numbers as in your picture, you have to adjust the counter subfigure
with \setcounter{subfigure}{<num>}
inside the subfigure
s
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\setcounter{subfigure}{2}%
\caption{A mouse}\label{fig:mouse}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\setcounter{subfigure}{0}%
\caption{A gull}\label{fig:gull}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{A tiger}\label{fig:tiger}
\end{subfigure}
\caption{Picture of animals}
\label{fig:animals}
\end{figure}
\end{document}
Output:
It's relatively easy with the floatrow
package, and its subfloatrow
environment:
\documentclass{article}
\usepackage{subcaption}
\usepackage{floatrow}
\usepackage{graphicx}
\usepackage[showframe]{geometry}
\begin{document}
\begin{figure}
\floatsetup{capposition = below, floatrowsep =qquad,}
\centering
\begin{subfloatrow}
\centering
\ffigbox[\textwidth]{\caption{The Death of Procris}}{%
\includegraphics[width=0.8\textwidth]{Piero_di_Cosimo_1}
}
\end{subfloatrow}
\vskip1cm
\begin{subfloatrow}
\ffigbox[0.5\textwidth]{\caption{Portrait of Simonetta Vespucci}}{%
\includegraphics[width=0.4\textwidth]{Piero_di_Cosimo_3}%
}
\ffigbox[0.5\textwidth]{\caption{Portrait of Simonetta Vespucci}}{%
\includegraphics[width=0.4\textwidth]{Piero_di_Cosimo_3}%
}
\end{subfloatrow}
\caption{Three paintings by Piero di Cosimo}
\label{PC}
\end{figure}
\end{document}
Within a figure environment you can start a tabular environment to have more control over the distribution of space. Fill the tabs with subfigures. You can even use the multirow
package for even further tweaking and control.
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{multirow}
\begin{document}
\begin{figure}[h]
\centering
\begin{tabular}[c]{ccccc}
\multirow{2}{*}[14pt]{
\begin{subfigure}{0.45\textwidth}
\includegraphics[height=2cm, width=\textwidth]{example-image-b}
\caption{CEO fixed / total}
\label{fig:ceoa}
\end{subfigure}
}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceob}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceoc}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceoe}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:cdfeod}
\end{subfigure}\\
&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:caeob}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceoac}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceose}
\end{subfigure}&
\begin{subfigure}[c]{0.11\textwidth}
\includegraphics[height=1cm, width=\textwidth]{example-image-a}
\label{fig:ceod}
\end{subfigure}\\
\end{tabular}
\caption{Compensation measures}
\label{fig:ceo}
\end{figure}
\end{document}