I want to reference an image in my LaTeX document. In order to do this, I wrote following code:
\begin{figure}[h!]
\centering
\includegraphics[scale=0.25]{img/2016_02_16_history_site_1.png}
\label{fig:history_site_1}
\caption{Some caption bla-bla}
\end{figure}
See image \ref{fig:history_site_1}.
When I compile the document, the caption under the image has number 6.3 (Fig. 6.3: Some caption bla-bla), but the reference has number 6.8 (See image 6.8.).
How should I modify the code in order for the number to be equal in both caption and the reference?
\captionprovides the anchor for\labeland not the figure-environment. – Marco Daniel Feb 16 '14 at 07:15