How to insert subfigure with caption in IEEE trans?
If you read IEEEtran
documentation will see that it recommends not using subfigure
package but subfig
. And an example with subfig
is explained in it.
What I understand you want is something like this:
which can be obtained with following code:
\documentclass{IEEEtran}
\usepackage{lipsum}
\usepackage{graphicx}
\ifCLASSOPTIONcompsoc
\usepackage[caption=false, font=normalsize, labelfont=sf, textfont=sf]{subfig}
\else
\usepackage[caption=false, font=footnotesize]{subfig}
\fi
\begin{document}
\section{A}
\lipsum
\section{B}
\lipsum[1-3]
\begin{figure}
\centering
\subfloat[a\label{1a}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\hfill
\subfloat[b\label{1b}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\\
\subfloat[c\label{1c}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\hfill
\subfloat[d\label{1d}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\caption{(a), (b) Some examples from CIFAR-10 \cite{4}. The objects in
single-label images are usually roughly aligned.(c),(d) However, the
assumption of object alignment is not valid for multi-label
images. Also note the partial visibility and occlusion
between objects in the multi-label images.}
\label{fig1}
\end{figure}
\lipsum[1-5]
\end{document}
here is another way:
\usepackage{subfigure}
\begin{figure}
\centering
\subfigure[First caption]
{
\includegraphics[width=1.0in]{imagefile2}
\label{fig:first_sub}
}
\\
\subfigure[Second caption]
{
\includegraphics[width=1.0in]{imagefile2}
\label{fig:second_sub}
}
\subfigure[Third caption]
{
\includegraphics[width=1.0in]{imagefile2}
\label{fig:third_sub}
}
\caption{Common figure caption.}
\label{fig:sample_subfigures}
\end{figure}
And the output: