user1424739
user1424739

Reputation: 13733

How to make plt.show() nonblocking?

In a python3 command line session, once I start plt.show(). I can not type any further python3 commands. Is there a way to make plt.show() nonblocking?

$ python3
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> x = [1, 2, 3]
>>> y = [3, 2, 1]
>>> plt.scatter(x,y)
<matplotlib.collections.PathCollection object at 0x7feb00256670>
>>> plt.show()

Upvotes: 0

Views: 297

Answers (1)

virxen
virxen

Reputation: 438

Use plt.ion() before plt.show() to enable interactive mode.

Upvotes: 2

Related Questions