[Tex/LaTex] How to align two diagrams on the same line

floatspositioning

I would like to know how can I put two diagrams on the same like rather than one of the top and one at the bottom. which consumed too much space on the paper. Here are the codes for the figure which I used.

  \begin{figure}[!htb]\centering
     \frame{\includegraphics[width=10cm]{Data1}}
     \caption{Interpolation for Data 1}
  \label{Fig:Data1}
  \end{figure}

  \begin{figure}[!htb]\centering
     \frame{\includegraphics[width=10cm]{Data2}}
     \caption{Interpolation for Data 2}
  \label{Fig:Data2}
  \end{figure}

Best Answer

\documentclass{article}
\usepackage[demo]{graphicx}% delete [demo] later
\begin{document}

\begin{figure}[!htb]\centering
   \begin{minipage}{0.49\textwidth}
     \frame{\includegraphics[width=\linewidth]{Data1}}
     \caption{Interpolation for Data 1}\label{Fig:Data1}
   \end{minipage}
   \begin {minipage}{0.49\textwidth}
     \frame{\includegraphics[width=\linewidth]{Data2}}
     \caption{Interpolation for Data 2}\label{Fig:Data2}
   \end{minipage}
\end{figure}

\end{document}

put them in one figure environment without an empty line between. The % is important here.

Related Question