3

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

enter image description here

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}
2
  • please make your code complete. \documentclass...\end{document}
    – touhami
    Commented Nov 13, 2015 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. Commented Nov 13, 2015 at 7:57

1 Answer 1

2

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.

4
  • But, whenever i use figure* the figure disappears Commented Nov 13, 2015 at 9:35
  • It should have just moved. figure* can only use t,b and p, not h. Commented Nov 13, 2015 at 13:51
  • 1
    @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. Commented Nov 14, 2015 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. Commented Nov 16, 2015 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .