Skip to content

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

Open

Description

@bishopAL

在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的问题吗?请问具体怎么解决?

Activity

  1. sunshe35 commented on Sep 16, 2019

    @sunshe35

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

  2. Xenon-Xu commented on Jun 5, 2020

    @Xenon-Xu

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

  3. sunshe35 commented on Jun 5, 2020

    @sunshe35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions