I want to insert to graphs into a paper. I want to make these two graphs arranged like the top 2 graphs in the following pic
however, using the following source, I can't see (a)
and (b)
what are potential problems? thanks!
the source codes are with a IEEEtran.cls
\documentclass[conference]{IEEEtran}
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png,.eps}
\else
\usepackage[dvips]{graphicx}
\DeclareGraphicsExtensions{.eps}
\fi
\usepackage{lscape}
%\usepackage{subfigure}
\usepackage{subcaption}
\begin{document}
\title{0000}
\author{\IEEEauthorblockN{00000}}
\maketitle
\end{abstract}
\IEEEpeerreviewmaketitle
\section{0000}
\begin{figure}[!htb]
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=.5\linewidth]{pic/loop.png}
\caption{First}
\label{subfig-1:dummy}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=.3\linewidth]{pic/twopath.png}
\caption{Second}
\label{subfig-2:dummy}
\end{subfigure}
\caption{Dummy figure}
\label{fig:dummy}
\end{figure}
\begin{thebibliography}{1}
\end{thebibliography}
\end{document}
Best Answer
Your error was to use the
subfigure
package with a wrong syntax; but thesubfigure
has been obsolete for several years and its author released a successor package,subfig
, in 1999.You have two alternatives. The first is using the more modern
subcaption
package; here's an example based on your sample code.One important point to note: you can use
\columnwidth
to set the width of the subfigures and\linewidth
in the argument to\includegraphics
for using the whole reserved space. Or, for bigger pictures, use\textwidth
but in the enclosingfigure*
environment, that will make a float as wide as the two columns.The second possibility is with
subfig
.The difference is that you don't have to specify a width for the subfloats like with
subcaption
. The syntax is quite different, as you can see. The output is just the same as before.