代码有一类matplotlib.axes.AxesSubplot,但模块matplotlib.axes有没有属性AxesSubplot
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。
有没有你想用此方法解决一个实际问题,或者这个问题只是好奇心? – Julian 2012-07-27 15:17:57
@Julian:这只是“好奇心”。我相信好奇心让你成为更好的开发者。 – user763305 2012-07-27 15:21:16