\documentclass[journal]{IEEEtran}
\usepackage[classicReIm]{kpfonts}
\usepackage{booktabs,tabularx,lipsum
\begin{document}
\begin{figure}[H]
\centering
\subfigure [\ RBM-based load forecast] {\includegraphics[width=7.5cm, keepaspectratio]{F_Load.eps} \label{fig1:subfig1}}
\subfigure [\ RBM-based RTPS forecast] {\includegraphics[width=7.5cm, keepaspectratio]{F_RTPS.eps} \label{fig1:subfig2}} %\vspace{-6pt}
\subfigure [\ RBM-based CPPS forecast] {\includegraphics[width=7.5cm, keepaspectratio]{F_CPPS.eps} \label{fig1:subfig2}} %\vspace{-6pt}
\caption[]{Price incentive-based DR schemes.}
\label{fig1}
\end{figure}
\end{document}
3 Answers
Several packages are missing:
float
to use[H]
graphicx
to include imagessubfigure
for the\subfigure
macro
multiple use of same label is also bad and missing }
in preamble
\documentclass[journal]{IEEEtran}
\usepackage[classicReIm]{kpfonts}
\usepackage{booktabs,tabularx,lipsum}
\usepackage{float}
\usepackage{graphicx}
\usepackage{subfigure}
\begin{document}
\begin{figure}[H]
\centering
\subfigure[RBM-based load forecast]{\includegraphics[width=7.5cm, keepaspectratio]{example-image}\label{fig1:subfig1}}
\subfigure[RBM-based RTPS forecast] {\includegraphics[width=7.5cm, keepaspectratio]{example-image} \label{fig1:subfig2}} %\vspace{-6pt}
\subfigure[RBM-based CPPS forecast] {\includegraphics[width=7.5cm, keepaspectratio]{example-image} \label{fig1:subfig3}} %\vspace{-6pt}
\caption[]{Price incentive-based DR schemes.}
\label{fig1}
\end{figure}
\end{document}
In your given code there are several issues:
- You have a missing
}
in your line\usepackage{booktabs,tabularx,lipsum
. - Related to your issue with a figure you need not to call
booktabs
andtabularx
. - You need to load package
float
to be able to use[H]
. We need to load packagegraphicx
with package optiondraft
to be able to use your used filenames for the used images. - A blank line inside
figure
results in starting a new paragraph. You have too much blank lines in yourfigure
environment, delete all of them. To get the three subfigures above each other you need a blank line between subfigures one and two and a blank line between subfigures two and three. - Instead the outdated package
subfigure
usesubcaption
orsubfig
. Please see that both call packagecaption
which results in an warning. To avoid this simply do not use a package for subfigures, use only figures. For the following example I usedsubfig
. - Use better labels for you figure (and tables and ...). Better is
\label{fig:<name>}
, so you can better remember and can use the same name for a table, a chapter, etc. if you use a leadingfig:
ortab:
orcha:
or ... - To be able to check if your used figure fits the column I used package
showframe
to visualize the typing area and margins only for this mwe.
Please have a look to this code:
\documentclass[journal]{IEEEtran}
\usepackage[classicReIm]{kpfonts}
\usepackage{lipsum}
\usepackage{subfig} % <=================================================
\usepackage[draft]{graphicx} % <========================================
\usepackage{float} % <==================================================
\usepackage{showframe}
\begin{document}
\begin{figure}%[H]
\centering
\subfloat[RBM-based load forecast\label{fig:subfig1}]{\includegraphics[width=7.2cm, keepaspectratio]{F_Load.eps}}
\subfloat[RBM-based RTPS forecast\label{fig:subfig2}]{\includegraphics[width=7.2cm, keepaspectratio]{F_RTPS.eps}}
\subfloat[RBM-based CPPS forecast\label{fig:subfig3}]{\includegraphics[width=7.2cm, keepaspectratio]{F_CPPS.eps}}
\caption{Price incentive-based DR schemes.}
\label{fig:figure1}
\end{figure}
\lipsum
Text see subfigures~\ref{fig:subfig1} and~\ref{fig:subfig3}.
\end{document}
and its result:
Please note that I had to correct your used width for the images from 7.5cm
to width=7.2cm
to get all three subfigures fitting one complete column ...
I guess the error message you got was floating too large ...
You're missing the appropriate package for subfloats.
You cannot use subcaption
, because caption
is incompatible with IEEEtran
. The subfigure
package is obsolete. The only choice is therefore subfig
, with the caption=false
option so the incompatible caption
will not be loaded.
Instead of explicit width of 7.5cm I used 0.9\columnwidth
; note that keepaspectratio
is not needed. It might make sense to use \columnwidth
.
I also added a trick for making the float to fill the column, but it depends on the final height of the images.
\documentclass[journal]{IEEEtran}
\usepackage[classicReIm]{kpfonts}
\usepackage{booktabs,tabularx,graphicx}
\usepackage[caption=false]{subfig}
\usepackage{lipsum}
\begin{document}
\lipsum[1-3]
\begin{figure}
\centering
\subfloat[RBM-based load forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig1}%
}
\subfloat[RBM-based RTPS forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig2}%
}
\subfloat[RBM-based CPPS forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig3}%
}
\caption{Price incentive-based DR schemes.}\label{fig1}
\end{figure}
\lipsum[4-5]
\begin{figure}
\sbox0{\small Fg}
\begin{minipage}[t][\dimexpr\textheight-\ht0][s]{\columnwidth}
\centering
\subfloat[RBM-based load forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig1-m}%
}
\vfill
\subfloat[RBM-based RTPS forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig2-m}%
}
\vfill
\subfloat[RBM-based CPPS forecast]{%
\includegraphics[width=0.9\columnwidth]{example-image}\label{fig1:subfig3-m}%
}
\caption{Price incentive-based DR schemes.}\label{fig1-m}
\vspace{-\dp0}
\end{minipage}
\end{figure}
\lipsum
\end{document}
\usepackage{booktabs,tabularx,lipsum
misses a closing}
. If you use\usepackage{booktabs,tabularx,lipsum,float,subfigure,graphicx}
probably the errors will go away butsubfigure
is said to deprecated.}
and some package calls ... Why did you tag withsidewaysfigure
?