For my paper, I want to have all of my figures and tables in the appendix at the end of my document and not in the main part of the document. I'm trying to put the figures in one section and the tables in a separate section but the appendix sections are printed on the first two lines of the page and then the figures and tables are randomly inserted after. How do I get them into separate section and in the order they are added? I have 7 figures and 3 tables total. This is the code I am using now:
\cleardoublepage
\appendix
\section{Figures}
\begin{figure}[h!]
\begin{subfigure}
\includegraphics[width=1in]{image1}
\caption{}
\label{img1}
\end{subfigure}
\begin{subfigure}
\includegraphics[width=1in]{image2}
\caption{}
\label{img2}
\end{subfigure}
\caption{some text}
\label{img12}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=1in]{image3}
\caption{some text}
\label{img3}
\end{figure}
\section{Tables}
\begin{longtable}[h!]{cc}
\caption{} \label{table1} \\
column1 & column2 \\
\hline
57.4 & -43.3 \\
60.6 & -24.5 \\
105.2 & -83.0 \\
30.2 & -27.3 \\
94.2 & -67.7 \\
28.4 & -68.8 \\
24.4 & -35.4 \\
47.1 & -120.0 \\
59.4 & -100.9 \\
82.5 & -60.3 \\
19.0 & -53.8 \\
111.9 & -26.2 \\
65.5 & -121.2 \\
60.2 & -33.9 \\
56.1 & -57.0 \\
56.6 & -91.3 \\
61.9 & -96.5 \\
59.9 & -46.6 \\
62.2 & -42.0 \\
35.8 & -34.7 \\
23.0 & -49.4 \\
88.7 & -61.5 \\
74.4 & -31.6 \\
71.8 & -66.8 \\
\end{longtable}
\begin{table}[h!]
\centering
\caption{}
\resizebox{\textwidth}{!}{\begin{tabular}{lllllllll}
& A d2l & A l2d & B d2l & B l2d & C d2l & C l2d & D d2l & D l2d \\
\hline
12 & 68.3 & -56.5 & 81.0 & -70.3 & 95.3 & -81.4 & 76.1 & -75.5 \\
11 & 105.2 & -102.3 & 79.8 & -82.1 & 103.7 & -90.4 & 84.5 & -81.2 \\
10 & 56.3 & -51.9 & 57.1 & -56.0 & 57.1 & -53.8 & 38.3 & -40.4 \\
9 & 91.1 & -83.1 & 107.9 & -103.7 & 93.1 & -96.4 & 101.9 & -86.7 \\
8 & 63.7 & -62.6 & 50.6 & -44.8 & 42.0 & -45.3 & 55.5 & -54.4 \\
7 & 68.3 & -50.4 & 56.3 & -56.8 & 65.1 & -52.8 & 59.1 & -60.4 \\
6 & 60.8 & -60.1 & 59.2 & -64.7 & 65.9 & -69.3 & 57.0 & -48.3 \\
5 & 89.9 & -79.7 & 87.7 & -92.0 & 90.6 & -81.0 & 88.5 & -86.9 \\
4 & 64.0 & -54.7 & 48.4 & -40.9 & 53.6 & -54.3 & 62.5 & -58.5 \\
\hline
\end{tabular}}
\label{table2}
\end{table}
endfloat