代码
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
print type(ax)
提供输出
<class 'matplotlib.axes.AxesSubplot'>
然后输入代码
import matplotlib.axes
matplotlib.axes.AxesSubplot
引发例外
AttributeError: 'module' object has no attribute 'AxesSubplot'
总而言之,有一个类matplotlib.axes.AxesSubplot
,但是模块matplotlib.axes
没有属性AxesSubplot
。到底是怎么回事?
我正在使用Matplotlib 1.1.0和Python 2.7.3。
嘿。这是因为在从AxesSubplot
构建一个类之前,没有[[is