代码
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。
https://stackoverflow.com/questions/11690597
复制相似问题