[Tex/LaTex] Two-column figures not displaying in IEEEtran document class

floatsieeetrantwo-column

I have a two column document in which I display a lot of figures. I also have to display some figures spanning the two columns.

To display "normal" figures I use this piece of code, for example:

\documentclass[conference]{IEEEtran}
\usepackage{subfig}
\usepackage{fixltx2e}
\usepackage{stfloats}

\begin{document}

\begin{figure}[!htb]
\centering
\subfloat[]{\includegraphics[width=0.49\linewidth]{figs/Case1/potential1_sd}} \hfill
\subfloat[]{\includegraphics[width=0.49\linewidth]{figs/Case1/potential2_sd}} \hfill
\subfloat[]{\includegraphics[width=\linewidth]{figs/Case1/sd_colorbar}} 
\caption{}
\label{fig:case1_sd}
\end{figure}

\end{document}

To span a figure in two columns:

\begin{figure*}
\centering
\subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/potential1_feat}} \hfill
\subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/potential2_feat}} \hfill
\subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/sd_colorbar}} 
\caption{}
\label{fig:case1_feat}
\end{figure*}

EDIT:

The problem seems to be happening with this piece of code:

\begin{figure*}
\subfloat[Vector Field]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_vector_field}} \hfill
\subfloat[Curl-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_rotational_free}} \hfill
\subfloat[Divergence-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_divergence_free}} \hfill
\subfloat[Harmonic]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_harmonic}} \\
% If I comment this line, everything works. Can't I use two rows too?
\subfloat[]{\includegraphics[width=.5\textwidth]{figs/Case1/quiver_colorbar}} 
\caption{Mean vector fields. The color bar represents the vectors magnitudes.}
\label{fig:case1_meanvecs}
\end{figure*}

If I commented it, the others figures, including two column figures displayed with the code above, can be seen in the document.

However, when I enable the second piece of code, all figures in my .tex disappear. I lose references, everything. I don't know what I'm doing wrong.

Thank you in advance.

Best Answer

To get a line break between (some of) the subfigures, just provide a blank line where the break should occur -- no need for \\.

By the way, I had to comment out the instruction \usepackage{stfloats} to get your code to compile. Do you really need this package?

enter image description here

\documentclass[conference]{IEEEtran}
\usepackage[demo]{graphicx} % added to make your file compilable
\usepackage{subfig}
\usepackage{fixltx2e}
%\usepackage{stfloats}

\begin{document}

\begin{figure*}
\subfloat[Vector Field]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_vector_field}} \hfill
\subfloat[Curl-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_rotational_free}} \hfill
\subfloat[Divergence-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_divergence_free}} \hfill
\subfloat[Harmonic]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_harmonic}} 

\subfloat[]{\includegraphics[width=.5\textwidth]{figs/Case1/quiver_colorbar}} 
\caption{Mean vector fields. The color bar represents the vectors magnitudes.}
\label{fig:case1_meanvecs}
\end{figure*}
\end{document}
Related Question