# Referencing figures doesn't work [duplicate]

Possible Duplicate:
Where to put the \label on a figure environment?

I'm having a problem with referencing figures in LaTeX. I have the following text:

\begin{figure}[H]
\center
\label{fig:enn1015}
\includegraphics[scale=0.40]{imagens/outputs/ENN_10_15.eps}
\caption{ENN unbalanced 10\%}
\end{figure}

The figure \ref{fig:enn1015} (...)


For some reason, the figure caption is:

Figure 3.5 Enn unbalanced 10%


But the text is:

The figure 3.2.1 (...)


The figure 3.5


It is printing the chapter.section.subsection the figure is in, and not the figure. Can anybody help me?

-

## migrated from stackoverflow.comDec 7 '11 at 15:08

This question came from our site for professional and enthusiast programmers.

## marked as duplicate by Werner, Torbjørn T., lockstep, Joseph Wright♦Dec 9 '11 at 10:08

Try putting your \label{} statement immediately after your \caption{} statement.
Edit: I'm not a total expert on how the \label command works, but I think it assigns a label to the last-seen "labelable" thing, so you want it right after your caption, which is "labelable" (my terminology). Currently, it is labeling whatever the last "labelable" thing was before your figure, probably a section heading or something (hence the 3.2.1).