When trying to create data plots that are not inlined in a notebook, there is some erroneous behaviour. Either the error described here happens, or the plots are shown and a crash report dialog pops up.
This happens with the following setup:
macOS Monterey 12.1
(using a virtual environment)
import numpy as np import matplotlib.pyplot as plt
This leads to the error described in the stack overflow link mentioned above. The cell with the call to plot() seems to be evaluated repeatedly. Sometimes, a plot window will show but get stuck, due to the repeated calls.
import numpy as np import matplotlib.pyplot as plt import matplotlib
This runs through smoothly, except for the fact that no plot is shown. The last cell’s call returns
[<matplotlib.lines.Line2D at 0x12f076bf1>] though. Adding
plt.show() does not help either. With TkAgg backend, the same behaviour is observed. Interestingly, when using MacOSX as a backend, I would expect, that the error from Example 1 would occur, but the behaviour is the same as with the other backends…
How can I plot my data externally to the notebook without any errors under the conditions described above? Please help!