Using the scrartcl class I have an incorrect numbering of Figures as illustrated in the example below. How can this problem be corrected? A MWE is listed below.
The code used for the example is listed below.
\documentclass{scrartcl}
\usepackage{blindtext}
\usepackage{graphicx}
\begin{document}
\section{Introduction}
\blindtext[1]
\section{Special case}
Figure \ref{fig:PV} shows an example of a PV system installed on farmland.
\begin{figure}
\centering
\includegraphics[width= 0.6\textwidth]{pv.png}
\label{fig:PV}
\caption{Green energy.}
\end{figure}
\end{document}
Image by Sebastian Ganso from Pixabay


scrartcl. The\labelmust come after\caption. – campa Feb 07 '22 at 16:07\includegraphics, the number comes from\captionand this\labelneeds to come after it. Otherwise the label points to the latest thing it can refer to in this case\section{Special case}which has the number2. – daleif Feb 07 '22 at 16:12\labelafter the\captionsolves the problem. The suggested answer "Why does an environment's label have to appear after the caption?" is spot on, although, to find that post you must already now how to solve the problem! – John Feb 08 '22 at 08:06