How to put two figures in the same page?

Some notes:

  • To solve your issue, to each figure add \begin{figure}[!htb]
  • Only one \centering is enough inside a figure/table environment, so you can remove the second one in each.
  • The "Figure 5 and Figure 6" you manually added can be done automatically by Latex, by adding \label{<your label>} inside of each figure then writing \ref{<your label>} or \cref{<your label>} (with the cleveref package) in the text. The label is of course, arbitrary.

cleveref offers some ways to customize your labels. For example

  • \cref{} = fig.
  • \Cref{} = Fig.

If you want to make all of them capitalized, then add capitalise to the package options. With a couple of additional commands we can make all of that bold, but I strongly suggest you don't use this because it will be too highlighted compared to the text.

Here's an example:

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage[capitalise]{cleveref}

\crefdefaultlabelformat{\textbf{#2#1#3}}
\crefname{figure}{\textbf{Fig.}}{\textbf{Figures}} 

\begin{document}  
Meanwhile, we also generate figures about the distribution of debris based on size (\cref{top}, \cref{bottom}). 
\begin{figure}[!htb]
    \centering
    \includegraphics[width=0.8\textwidth]{example-image-a}
    \caption{Spatial density of space debris ranging from 1cm to 10cm.}
    \label{top}
\end{figure} 
\begin{figure}[!htb]
    \centering
    \includegraphics[width=0.8\textwidth]{example-image-b}
    \caption{Spatial density of space debris larger than 10cm.} 
    \label{bottom}
\end{figure} 
\end{document} 

If you want the figures to be on the same page no matter what, use a single figure environment.

\documentclass{article}
\usepackage{graphicx}

\begin{document}

Meanwhile, we also generate figures about the distribution of debris based
on size (figures \ref{top}~and~\ref{bottom}).

\begin{figure}[htbp]
\centering

\includegraphics[width=0.8\textwidth,height=5cm]{example-image-a}
\caption{Spatial density of space debris ranging from 1cm to 10cm.}\label{top}

\bigskip

\includegraphics[width=0.8\textwidth,height=5cm]{example-image-b}
\caption{Spatial density of space debris larger than 10cm.}\label{bottom}

\end{figure}

\end{document}

Remember the p position specifier.

enter image description here

Tags:

Floats