Figure reference \ref{fig:result} renders as ?? in PDF

Your labels don't match. Change the reference to \ref{mylabel} or the label to label{fig:result}


Besides the mistake noted by Lev Bishop (assuming that you just did some incomplete editing for this post, and in reality the labels match), it is possible that you did not run latex enough times. For the labels to work out you need to run it at least twice.


I also had similar issue where pdflatex didn't update the Figure reference. I later found out that it is because of {\caption{.....}}\label{} incorrect usage. The \caption and \label commands have to be together like \caption{.....}\label{}. The caption command and its contents should not be enclosed with braces.