% Created 2019-04-30 mar. 23:15
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage[newfloat]{minted}
\date{}
\title{Test of source block exports}
\hypersetup{
 pdfauthor={Emmanuel Charpentier},
 pdftitle={Test of source block exports},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.1 (Org mode 9.2.3)}, 
 pdflang={English}}
\begin{document}

The Python block \ref{org471e7a4} generates the figure \ref{fig:orgb0ae5e3}

\begin{figure}[htbp]
\centering
\includegraphics[height=2.5in]{Fig2.png}
\caption{\label{fig:orgb0ae5e3}
Figure generated by python}
\end{figure}


\begin{listing}[htbp]
\begin{minted}[]{python}
import matplotlib, numpy
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(4,2))
x=numpy.linspace(-15,15)
plt.plot(numpy.sin(x)/x)
fig.tight_layout()
plt.savefig('Fig2.png')
return 'Fig2.png'
\end{minted}
\caption{\label{org471e7a4}
Python code generating a figure}
\end{listing}

Problem: whereas the HTML export labels the source listing as "Listing 1" and is correctly refers to 1, the PDF export labels it "Figure 2" (and points to it) \textbf{when the default \texttt{verbatim} method is used.} When one bothers to use \texttt{minted}, the result is correct.
\end{document}