My solution
# cmd or conda
pip install pyqt5
import matplotlib
matplotlib.use('Qt5Agg')
it doesn't need to set
plt.show(block=True)
or
plt.interactive(False)
solution 1
import matplotlib.pyplot as plt
plt.show()
solution 2
plt.interactive(False)
I realize this is old but I figured I'd clear up a misconception for other travelers. Setting plt.pyplot.isinteractive() to False means that the plot will on be drawn on specific commands to draw (i.e. plt.pyplot.show()). Setting plt.pyplot.isinteractive() to True means that every pyplot (plt) command will trigger a draw command (i.e. plt.pyplot.show()). So what you were more than likely looking for is plt.pyplot.show() at the end of your program to display the graph.
As a side note you can shorten these statements a bit by using the following import command import matplotlib.pyplot as plt rather than matplotlib as plt.
solution 3
plt.show(block=True)
it works for me
but you need click to show next image
solution 4
import matplotlib
matplotlib.use('TkAgg')
It works for me too, but the problem is it will lead the error when you want to save figures in a loop.