Matplotlib plt.show(block=False)
gives me a black window when plotting something that normally would work with plt.show(block=True)
. With my previous Ubuntu install I could always run plt.show(block=False)
without any issues.
Here is a simple piece of code that gives me the black screen:
y = np.random.random(10)
x = np.linspace(1, len(y), len(y))
plt.plot(x, y)
plt.show(block=False)
time.sleep(5)
The graph is displayed properly when I use block=True
, but gives a black window with the code above. This happens in both Python 3 console and IPython.
Extra information:
- Fresh install of Ubuntu 20.04.4.
- Python 3.8.10.
- Matplotlib version 3.5.1.
- Tested with backends: [QtAag, Qt5Aag, TkAgg], with the same results.
Any help would be much appreciated. I mostly use the block=False
argument to view/analyze the data whilst zooming-in, etc., on the graph.