1

I have 5 figures, which I want to display in one page, after dividing it in three minipages. Idellay I have 2 subfigures in the first minipage, 2 in the second one, and only one in the third minipage center-aligned.

I tried the following:

\documentclass[a4paper,10pt]{article}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage[paper=letterpaper,left=1.0in,right=1.0in,top=0.25in,bottom=1.0in,]{geometry}

\begin{document}

\begin{figure}
\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[a]{\includegraphics[width=.5\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
   \label{fig:subfig1}
 }%
\end{subfigure}
 \begin{subfigure}[b]{\includegraphics[width=.5\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
   \label{fig:subfig2}
 }%
\end{subfigure}
\label{fig:myfigure}
\end{minipage}

\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[c]{\includegraphics[width=.5\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
   \label{fig:subfig1}
 }%
\end{subfigure}
 \begin{subfigure}[d]{\includegraphics[width=.5\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
   \label{fig:subfig2}
 }%
\end{subfigure}
\label{fig:myfigure}
\end{minipage}

\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[f]{\includegraphics[width=\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
   \label{fig:subfig1}
 }%
\end{subfigure}
\caption{My caption}
\end{minipage}

\end{figure}

Unfortunately, the result is totally hopeless. Any suggestion on how to fix it? Thanks in advance

Dario
  • 1,340
  • 1
    Watch out, not \begin{minipage}{03.\textheight}, it is \begin{minipage}{0.3\textheight} –  Apr 15 '19 at 13:25
  • @ferahfeza. You are right. thanks. However, Figures come one after the other. I cannot obtain two figures in the first minipage, two in the second and one in the third. Any suggestion on this issue? – Dario Apr 15 '19 at 13:41
  • Do you want to obtain the two figures side by side in minipage? –  Apr 15 '19 at 13:59
  • 1
    delete empty lines between minipages. however, do you really need minipages? you can obtain desired result also without using them. – Zarko Apr 15 '19 at 14:00
  • @ferahfeza Indeed. – Dario Apr 15 '19 at 14:00
  • @Dario, look at this nice answer : https://tex.stackexchange.com/a/261301/31034 –  Apr 15 '19 at 14:01
  • @Zarko I deleted the space in the between and it worked. However, the last figure is not center-aligned, but it goes below the column on the left. How can I obtain this? – Dario Apr 15 '19 at 14:08
  • @ferahfeza Thanks for the suggestion. I am almost there. The last point is that the last figure is not centered, but it goes below the first column. – Dario Apr 15 '19 at 14:09
  • Solved! In the last minipage I substitute \begin{minipage}{0.3\textwidth} with \begin{minipage}{\textwidth} – Dario Apr 15 '19 at 14:11
  • @Dario, see my answer. test it since temporary is not possible to upload images. – Zarko Apr 15 '19 at 14:20

1 Answers1

1
  • the package subfigure is obsolete. it is replaced with subfig. however, even better is to use the subcaption package.
  • i would not use minipage for grouping your sub figures, this can be done without them:

    \documentclass[a4paper,10pt]{article}
    \usepackage[demo]{graphicx}
    \usepackage{subcaption}
    \usepackage{amsmath}
    \usepackage[paper=letterpaper,
                left=1.0in,right=1.0in,
                top=0.25in,bottom=1.0in,]{geometry}
    
    \begin{document}
        \begin{figure}
    \centering
        \begin{subfigure}{0.45\linewidth}
    \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png}
    \caption{}
    \label{fig:subfig1}
        \end{subfigure}\hfil
        \begin{subfigure}{0.45\linewidth}
    \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
    \caption{}
    \label{fig:subfig2}
        \end{subfigure}
    
    \smallskip
         \begin{subfigure}{0.45\linewidth}
    \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png}
    \caption{}
    \label{fig:subfig3}
        \end{subfigure}\hfil
         \begin{subfigure}{0.45\linewidth}
    \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
    \caption{}
    \label{fig:subfig4}
        \end{subfigure}
    
    \smallskip
         \begin{subfigure}{0.45\linewidth}
    \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png}
    \caption{}
    \label{fig:subfig5}
        \end{subfigure}
    
    \caption{My caption}
    \label{fig:my-figures}
        \end{figure}
    See Fig.~\ref{fig:my-figures}, particularly sub figure \ref{fig:subfig5} \dots
    \end{document}
    

enter image description here

Zarko
  • 296,517