# [Tex/LaTex] 3 images side by side

graphics

I want to position 3 images side by side. Actually I am doing like this, but they don't get side by side (see the pic on the bottom). Also is there any way to show only 1 caption for these 3 figures?

\begin{figure}[ht]

\begin{minipage}[b]{0.3\linewidth}
\centering
\includegraphics[scale=1]{i/houghtrain.png}
\caption{default}
\label{fig:figure1}
\end{minipage}

\hspace{0.3cm}

\begin{minipage}[b]{0.4\linewidth}
\centering
\includegraphics[width=\textwidth]{i/houghframe.png}
\caption{default}
\label{fig:figure2}
\end{minipage}

\hspace{0.3cm}

\begin{minipage}[b]{0.4\linewidth}
\centering
\includegraphics[width=\textwidth]{i/houghspace.png}
\caption{default}
\label{fig:figure3}
\end{minipage}
\end{figure}


They are not good positioned:

We can go outside the margin of the document if it is needed

If you just want three images side by side they can be positioned just as you would position three letters or boxes, no need for minipage wrappers etc. I also added p to your optional argument as not having it makes it more likely the float will go to the end of the document.

\begin{figure}[htp]

\centering
\includegraphics[width=.3\textwidth]{i/houghtrain.png}\hfill
\includegraphics[width=.3\textwidth]{i/houghframe.png}\hfill
\includegraphics[width=.3\textwidth]{i/houghspace.png}

\caption{default}
\label{fig:figure3}

\end{figure}