The code
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
print type(ax)
gives the output
<class 'matplotlib.axes.AxesSubplot'>
Then the code
import matplotlib.axes
matplotlib.axes.AxesSubplot
raises the exception
AttributeError: 'module' object has no attribute 'AxesSubplot'
To summarize, there is a class matplotlib.axes.AxesSubplot, but the module matplotlib.axes has no attribute AxesSubplot. What on earth is going on?
I'm using Matplotlib 1.1.0 and Python 2.7.3.