I want to refer to a figure within a section (say 1.2), using \ref{fig:xyz}
Section:
\section{XYZ}
Figure:
\begin{figure}
\includegraphics[width=1\linewidth]{xyz.jpg}
\label{fig:xyz}
\caption[XYZ]
\end{figure}
When I add \ref{label:001} to my document, it does not link to the figure, but to the section (1.2).
What can I get it right?
ref
,label
andsection
. Maybe my question is a good addition, maybe not.