plt.ion()最近更改了行为

时间:2019-03-13 09:18:57

标签: python matplotlib upgrade major-upgrade

以下python脚本不再显示数字,就像以前在我的计算机上显示的一样:

import matplotlib.pyplot as plt

plt.scatter(1, 1)
plt.show() # Blocks and opens a graphical window as usual.

plt.ion()
plt.scatter(1, 1) # Does *not* open a graphical window anymore as I expect.
plt.scatter(2, 2) # Does *not* update the graphical window anymore as I expect (there is still no window at all)

plt.ioff()
plt.show() # The window opens at last, but it's blocking.

我还注意到图形窗口样式已更改(底部栏):

matplotlib new style

我的猜测是这是因为我的Arch系统最近已升级到matplotlib 3.0.3-1。但是我没有看到What's New页面上ion()的重大变化。

可能是什么原因造成的?
我如何像以前在两次ion()ioff()两次发票之间获取那样,逐步获取无阻塞图?


[UPDATE] 我可以确认降级到matplotlib 2.2.3-2确实恢复了预期的行为。因此,问题似乎出在matplotlib或其环境的最新升级中。

[UDPATE] 提交于matplotlib issue tracker

0 个答案:

没有答案