[Tex/LaTex] Inserting two figures below each other

floats

I wanted to insert two figures, one below the other, and then continue entering text after figure 2. But the text gets inserted after figure 1. Can someone please tell me what I am doing wrong? The following are the commands I used (document class is report):

\begin{figure}[h]
   \centering
    \includegraphics[scale=0.5]{figure1.png}
     \caption{this is figure 1}\label{one}
\end{figure}
\begin{figure}[h]
   \centering
    \includegraphics[scale=0.5]{figure2.png}
     \caption{this is figure 2}\label{two}
\end{figure}

Best Answer

To keep both figures together, use a single figure environment. If you want to decide on your own where images shall appear, avoid using the figure environment.

\documentclass{report}
\usepackage{graphicx}
\usepackage{blindtext}
\begin{document}
\begin{figure}[h]
\centering
\includegraphics[width=.5\textwidth]{example-image-a}
\caption{this is figure 1}\label{one}
\bigbreak
\includegraphics[width=.5\textwidth]{example-image-b}
\caption{this is figure 2}\label{two}
\end{figure}
\blindtext
\end{document}
Related Question