【发布时间】:2020-02-13 02:42:42
【问题描述】:
我已经很好地使用了下面的 python 代码,但是当我重新安装 Anaconda python 2.7 版本时,该代码有错误。为什么会这样?
plt.subplots_adjust(top=0.9, bottom=0.05, left=0.05, right=0.95, wspace=0.55, hspace=0.2)
plt.figtext(0.5, 0.95, str(os.path.basename(self.filepath)),ha='center', color='black', weight='bold', size='small')
mngr = plt.get_current_fig_manager()
mngr.window.setGeometry(810, 30, 800, 800)
show()
Traceback (most recent call last):
File "C:\Users\hyeyoung\Desktop\20200211MHyeyoung.py", line 4482, in onOpenImageFile
self.ShowAFewFrames()
File "C:\Users\hyeyoung\Desktop\20200211MHyeyoung.py", line 4509, in ShowAFewFrames
mngr.window.setGeometry(810,30,800, 800)
AttributeError: 'FigureManagerBase' object has no attribute 'window'
--------------------------------------------------------------------------
Anaconda python ver. : 2.7
matplotlib ver. :2.2.2
please give me an answer. thx
【问题讨论】:
-
请分享整个错误信息。你为什么使用 Python 2?
-
另外,查看
FigureManagerBase的文档,我看不到window属性,因此请检查。 -
我将整个错误附加到帖子中。因为python代码是2.7版本
标签: python matplotlib window