[Tex/LaTex] Figure number wrong

floatsnumbering

I know this has been asked a lot, and I've browsed all possible answers, but none help. This is my code:

\documentsclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\begin{document}
\begin{figure}[h]
\centering 
\includegraphics[scale=0.5]{example-image}
\caption{Lipsum}
\label{fig:saussure} 
\end{figure}
\end{document}`

This is the first (and only figure) of my paper. However, in the text, the figure number is not 1 but 2.1 (section in which it appears).
I have made sure that the label is after the caption. I've even tried out putting the label inside the caption, or putting the caption at the top and the label at the end. Nothing works and the figure number remains the section number. How can I change this??

Best Answer

As you hint at yourself, the line

\numberwithin{figure}{section}

means that figures are numbered per section, so the output you're seeing is in fact exactly what you have told LaTeX to do. Anyway, getting continous numbering of figures is of course just a matter of deleting that line.

Related Question