[Tex/LaTex] How to make 8 subfigures fit in one page

subcaptionsubfloats

I am a newbie in Latex and I have 8 figures with equal sizes to plot. I want to arrange them in 4*2 and plot them in one page.

 \begin{figure}
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots1.pdf}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots2.pdf}
    \end{subfigure}
    \\
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots3.pdf}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots4.pdf}
    \end{subfigure}
     \\
     \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots5.pdf}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots6.pdf}
    \end{subfigure}
     \\
     \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots7.pdf}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.32\textwidth}
        \includegraphics[width=\textwidth]{plots8.pdf}
    \end{subfigure}
\caption{blah blah blah blah ...}
\end{figure}

I want to do these:

  1. Reduce the horizontal distance between two subfigures to have equal distances between them and the edge of the page.
  2. Reduce the vertical distance between two subfigures so I may be able to increase the size of each of them. (The reason why I chose 0.32\textwidth is because I wanted to fit them all in one page. Do you have better idea to increase their width and height? They don't need to keep the ratio between width and height of the original images)
  3. Add subcaptions on the top-left (or left) of each image as a,b,c,d,…

I would really appreciate it if you can help me.
Thanks a lot.
Ali

Best Answer

Probably you looking for something like this:

enter image description here

For this figure I use subfig and floatrow packages:

\documentclass{article}
\usepackage{floatrow}
\usepackage{graphicx}
\usepackage[label font=bf,labelformat=simple]{subfig}
\usepackage{caption}
\floatsetup[figure]{style=plain,subcapbesideposition=top}

\usepackage[showframe]{geometry}

\begin{document}
%---------------------------------------------------------------%
    \begin{figure}[htbp]
    \centering
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:a}}
\hfil
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:b}}

\medskip
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:c}}
\hfil
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:d}}

\medskip
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:e}}
\hfil
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:f}}

\medskip
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:g}}
\hfil
\sidesubfloat[]{\includegraphics[width=0.4\textwidth]{example-image}\label{fig:h}}
\caption{Main caption \dots}
    \label{fig:myfigure}
    \end{figure}
\end{document}