Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter09的MatplotlibWidget.py文件运行报错 #13

Open
bishopAL opened this issue Jun 3, 2019 · 3 comments
Open

Chapter09的MatplotlibWidget.py文件运行报错 #13

bishopAL opened this issue Jun 3, 2019 · 3 comments

Comments

@bishopAL
Copy link

bishopAL commented Jun 3, 2019

在Chapter09的MatplotlibWidget.py文件运行报错,信息如下: File "C:\Users\bisho\Downloads\Compressed\PyQt5-master\PyQt5-master\Chapter09\MatplotlibWidget.py", line 27, in init self.axes.hold(False) # 每次绘图的时候不保留上一次绘图的结果 AttributeError: 'AxesSubplot' object has no attribute 'hold'。
这是matplotlib的问题吗?请问具体怎么解决?

@sunshe35
Copy link

你的matplotlib版本太新了,我用2.1.2的版本没有问题。
这种bug一般是版本问题,时间长了就能自动排除。

@Xenon-Xu
Copy link

Xenon-Xu commented Jun 5, 2020

self.axes.hold(False) 将这句话去掉
每次绘图前调用 self.axes.clear() 清除上一次绘图就行

@sunshe35
Copy link

sunshe35 commented Jun 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants