The code
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
print type(ax)
gives the output
Another way to see what DSM said:
In [1]: from matplotlib import pyplot as plt
In [2]: type(plt.gca()).__mro__
Out[2]:
(matplotlib.axes._subplots.AxesSubplot,
matplotlib.axes._subplots.SubplotBase,
matplotlib.axes._axes.Axes,
matplotlib.axes._base._AxesBase,
matplotlib.artist.Artist,
object)
with the dunder method resolution order you can find all the inheritances of some class.