I have two figures a and b. I want to put them in the same line with margin and center. I am using two columns format to write the paper but the figure will be one column. I used the bellow code, but two figure are in the wrong location: one is left and one is right of the page. How can I fix it?
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{caption}
\begin{figure*}
\centering
\subfigure[a]{%
\includegraphics[width=0.23\textwidth]{a}%
\label{fig:a}%
}%
\hfill
\subfigure[b]{%
\includegraphics[width=0.228\textwidth]{b}%
\label{fig:b}%
}%
\caption{xxx}
\label{fig:ab}
\end{figure*}
Best Answer
First Version
The
subcaption
package is an alternative tosubfig
. With\caption{caption one}
... you also could use subcaptions.MWE:
2.version ref to your comment
With
\hspace{}
you could customize the margin between images. In the example\hspace{0.2cm}
is used.