1

I am trying to get what's on the picture:

enter image description here

This is what I've tried so far:

\begin{figure}[H]
\centering
\begin{subfigure}{.5\textwidth}
    \centering
    \includegraphics[width=.9\linewidth]{100k_rmse_gamma.png}
    \caption{A subfigure}
    \label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
    \centering
    \includegraphics[width=.9\linewidth]{1m_rmse_gamma.png}
    \caption{A subfigure}
    \label{fig:sub2}
\end{subfigure}
\caption{1M}
\label{fig:test}
\end{figure}



\begin{figure}
\centering
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.4\linewidth]{image1}
\captionof{figure}{A figure}
\label{fig:test1}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.4\linewidth]{image1}
\captionof{figure}{Another figure}
\label{fig:test2}
\end{minipage}
\end{figure}

Do we always have to use this approach or there is a special package for addressing this?

  • 4
    You are most likely using subcaption already in your first example. That would be a special package. – Johannes_B May 14 at 5:31
1

mwe

\documentclass{article}
\usepackage{graphicx,subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}[t]{.47\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{The A\label{A}}\end{subfigure}\hfill
\begin{subfigure}[t]{.47\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{The B\label{B}}\end{subfigure}\\
\begin{subfigure}[t]{0.47\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\caption{The C\label{C}}\end{subfigure}\hfill
\begin{subfigure}[t]{0.47\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{The Image\label{Image}}\end{subfigure}
\caption{Four subfigures}
\end{figure}
\end{document}

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.