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


Question: What does "flattens" mean in this context?
Answer: Guessing a bit, as I'm not a programmer...


"Flatten the list"
Two possibilities, so I would really check with the test setter...  


Empty the list, ready to start the task (most likely)
Take the nested lists &amp; concatenate them into one list (less likely)

"depth of the list"
Again, I see two possibilities &amp; I have no idea as to which may be more appropriate ...


Calculate the total number of list lines, including all nested lists  
Calculate the number of levels used in the nesting.



A coder might know better.