0

All of my figures seem to be referencing correctly except for one. I have

Text text text \ref{fig:label}.
\begin{figure}
    \begin{center}
        <TikZ Drawing>
    \end{center}
\label{fig:label}
\end{figure}

The figure ends up being Figure 2.1 in the document body, however the reference only shows up as Figure 2 whereas other figures in the chapter show up referenced correctly (e.g. Figure 2.2).

EDIT: Did some more googling and found that I shouldn't be using the center environment for floats but using \centering instead. Removing \begin and \end{center} and replacing with a single \centering within the figure definition fixes the problem.

EDIT2: Not allowed to answer my own question for 8 hours.