[Tex/LaTex] why does subfigure show wrong reference number

floatssubfloats

I am using \begin {figure}-\end {figure} for one figure and \begin {figure} \subfigure{} \end {figure} for multiple figures joined on a page. (By using \usepackage{subfigure})
When I refer the \subfigure (multiple figure in one figure label, referring number shows wrong. for example, it should be Figure (5), but it shows Figure (3.1)
This is one of my subfigure code.

\begin{figure}{
\centering
\caption{Validation of Revolving by Categories}
\subfigure [Frequency of Revolving (Promotional Cash)]{
    \includegraphics[scale=0.8]{category_a1.png}}
\subfigure [Conditional Expectation (Promotional Cash)]{
    \includegraphics[scale=0.8] {category_a2.png}}
\subfigure [Frequency of Revolving (Regular Cash Withdrawal)]{
    \includegraphics[scale=0.8]{category_b1.png}}
\subfigure [Conditional Expectation (Regular Cash Withdrawal)]{
    \includegraphics[scale=0.8]{category_b2.png}}
\subfigure [Frequency of Revolving (Retail Transactions)]{
    \includegraphics[scale=0.8]{category_c1.png}}
\subfigure [Conditional Expectation (Retail Transactions)]{
    \includegraphics[scale=0.8]{category_c2.png}}

}
%\scriptsize{Notes. (a) depicts }


\label{fig:revol}
\end{figure}

Best Answer

subfigure package is obsolete. Use subfig package instead. I prefer using subcaption package which provides subfigure environment.

\documentclass[12pt,demo]{elsarticle}
%%%\usepackage{subfig} do not use load this package

\usepackage{subcaption} %%% 

\begin{document}

\begin{figure}
\centering
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8]{category_a1.png}
    \caption{Frequency of Revolving (Promotional Cash)}
    \label{subfig:cash}
\end{subfigure}
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8] {category_a2.png}
    \caption{Conditional Expectation (Promotional Cash)}
    \label{subfig:pcash}
\end{subfigure}
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8]{category_b1.png}
    \caption{Frequency of Revolving (Regular Cash Withdrawal)}
    \label{subfig:frwith}
\end{subfigure}
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8]{category_b2.png}
    \caption{Conditional Expectation (Regular Cash Withdrawal)}
    \label{subfig:cewith}
\end{subfigure}
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8]{category_c1.png}
    \caption{Frequency of Revolving (Retail Transactions)}
    \label{subfig:frtra}
\end{subfigure}
\begin{subfigure}{.4\textwidth}
    \includegraphics[scale=0.8]{category_c2.png}
    \caption{Conditional Expectation (Retail Transactions)}
    \label{subfig:cetra}
\end{subfigure}
\caption{Validation of Revolving by Categories}
\label{fig:revol}
\end{figure}

Refer to figure~\ref{fig:revol}
\end{document}

enter image description here