I use a composed figure that contains two subfigures implemented via subfloats. Example code:
\begin{figure}
\centering
\subfloat[Workload = 1,000]{
\includegraphics[width=0.45\linewidth]{img/fib-1k-dyn.eps}
\label{subfig:fib1k}
}
\qquad
\subfloat[Workload = 20,000]{
\includegraphics[width=0.45\linewidth]{img/fib-20k-dyn.eps}
\label{subfig:fib20k}
}
\label{fig:fib}
\caption{Fibonacci benchmark with fixed workload, dynamic scheduling}
\end{figure}
When I refer to the first subfigure via \ref{subfig:fib1k} the really pretty text is displayed such as 5.1a or 5.1b in the analogous reference.
However, sometimes I need to refer to the whole image, i.e. \ref{fib}. In that case I'd expect 5.1 (without the letter of course). Instead, unknown reference is presented ??.
How can I refer to it properly? I use pdflatex and \usepackage{subfig} package.