I don't know why appear this in my code

This is my code
\documentclass[12pt, openany]{book}
\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\begin{ejemplo}
Hallemos los extremos de $(x^2+y^2)e^{-x^2-y^2}$. véase figura \ref{parw}
\begin{figure}[htb]
\centering
\begin{tikzpicture}
\begin{axis}[
width=0.5\linewidth,
xlabel=$x$,ylabel=$y$
]
\addplot3[surf,domain=-2:2,domain y=-2:2]
{((x^2+y^2)*exp(-x^2-y^2))};
\end{axis}
\end{tikzpicture}
\label{parw}
\caption{}
\end{figure}
\end{ejemplo}
\end{document}
\labelhas to be placed after the\caption. Edit: and you have to compile the document twice. – Torbjørn T. Feb 25 '22 at 22:12