You are reading an old version of the documentation (v2.2.4). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.delaxes.html
Version 2.2.4
matplotlib
Fork me on GitHub

matplotlib.pyplot.delaxes

matplotlib.pyplot.delaxes(ax=None)[source]

Remove the given Axes ax from the current figure. If ax is None, the current axes is removed. A KeyError is raised if the axes doesn't exist.