I'm attempting to reference a figure
containing a tikzpicture
from pgfplots
. However, for some reason, I'm getting ?? instead of the figure number when I \ref
it.
Any ideas what I'm doing wrong?
The section is below:
\subsection{Graph of Results}
Figure \ref{fig:ResultsGraph} shows the data gathered in Table \ref{tbl:ResultsData}.
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[legend pos=north east,anchor=west, xlabel={$\dfrac{1}{T} / K^{-1}$}, ylabel={$ln P*_a$}]
\addplot table [only marks, x=1/T,y=lnPa]{GraphData.txt};
\addplot [thick, red] table[y={create col/linear regression={y=lnPa}}]{GraphData.txt};
\addlegendentry{$\dfrac{dy}{dx} = \pgfplotstableregressiona$}
\addlegendentry{$y_{intercept} = \pgfplotstableregressionb$}
\end{axis}
\label{fig:ResultsGraph}
\end{tikzpicture}
\caption{Graph to show the relationship between the natural log of pressure and the inverse of temperature}
\end{figure}
\label
should appear after\caption
- see here.