In Pycharm
import matplotlib.pyplot as plt
plt.interactive(True)
plt.plot([1,2,3,4])
The figure showed up and disappeared instantly.
How to set the figure to keep showing?
Since you are in interactive mode the figure will not stay open. You may simply not use interactive mode,
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()
or you may turn it off before showing the figure.
import matplotlib.pyplot as plt
plt.interactive(True)
plt.plot([1,2,3,4])
plt.ioff()
plt.show()