# Two columns figure using subfloat

I am trying to make a two column figure of set of subfigures using subfloat. My problem is that the figure appears in one column only and the rest of the figure is not displayed as shown in the following figure

this is my code :

\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{subfloat}
\usepackage{subfig}
\usepackage{algorithmic}

\begin{document}
\begin{figure}
\centering
\subfloat[Tree-2]{\includegraphics[scale=0.45]{img1.png}}\label{img1}
\subfloat[Tree-4]{\includegraphics[scale=0.45]{img2.png}}\label{img2}\\
\subfloat[Tree-6]{\includegraphics[scale=0.45]{img3.png}}\label{img3}
\subfloat[Tree-10]{\includegraphics[scale=0.45]{img4.png}}\label{img4}\\
\subfloat[Tree-15]{\includegraphics[scale=0.45]{img5.png}}\label{img5}
\subfloat[Tree-20]{\includegraphics[scale=0.45]{img6.png}}\label{img6}\\
\caption{confusion matrix.}
\label{fig:confusion}
\end{figure}

\end{document}

• please make your code complete. \documentclass...\end{document} – touhami Nov 13 '15 at 6:39
• Maybe your figure is just too wide? If two figures do not fit next to each other in one row on a page, there will be a line break between them. Maybe you can use landscape paper format, or you can scale the figures to solve this. – Thomas Weise Nov 13 '15 at 7:57

Alternatively to my above comment:

If you use a double-column format like IEEEtran, you might want to use the figure* environment instead of the figure environment. figure only occupies one column. figure* spans both.

• But, whenever i use figure* the figure disappears – Ahmed Abobakr Nov 13 '15 at 9:35
• It should have just moved. figure* can only use t,b and p, not h. – John Kormylo Nov 13 '15 at 13:51
• @ahmedabobakr Using the code in your question (adding a \begin{document}), and changing from \begin{figure}...\end{figure} to \begin{figure*} ... \end{figure*} I get a figure spanning two columns. – Torbjørn T. Nov 14 '15 at 23:50
• @TorbjørnT. Yup thanks, It sounds like I have a problem with my Latex compiler, because, I tested it on another machine and it works well. – Ahmed Abobakr Nov 16 '15 at 8:14