Search code examples
latexoverleaf

How do I fit 3 figures vertically in Overleaf Latex?


Good day, I am trying to fit 3 figures on the same page so that they do not occupy more space than needed. Problem is I can not get it to fit.

Here is my code:

\onecolumn
    
    \begin{figure}[!htb]
        \centering
        \includegraphics[height=0.33\textheight]{sections/images/MaximumSoundEnergy .png}
        \caption{Low-Pass Filtered Signal Algorithm}
        \label{fig:image_label}
    \end{figure}
    
    \begin{figure}[!htb]
        \centering
        \includegraphics[height=0.33\textheight]{sections/images/LowPassFilter.png}
        \caption{Low-Pass Filtered Signal Algorithm}
        \label{fig:image_label}
    \end{figure}
    
    \begin{figure}[!htb]
        \centering
        \includegraphics[height=0.33\textheight]{sections/images/MaximumSlope.png}
        \caption{Low-Pass Filtered Signal Algorithm}
        \label{fig:image_label}
    \end{figure}

\twocolumn

I had to use \onecolumn because the rest of my document is in 2 columns.

here it is how it looks like


Solution

  • Using height=0.33\textheight sets the height of the images themselves to to 1/3 of that of the text height.

    This does not take into account the room for the labels and the spacing between figures.

    You will have to make height smaller until all three images fit.