How to make the plot not disappear?

Suppose you need to store the figure and subplot variables in variables (to change the attributes later). How can you make the whole figure stay and not disappear immediately after a few milliseconds?

 import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(2,2,1) ax.plot(1) fig.show() 
+6
source share
1 answer

Change fig to plt :

 plt.show() 
+12
source

Source: https://habr.com/ru/post/925122/


All Articles