matplotlib.pyplot.gcf — Matplotlib 3.10.3 documentation (original) (raw)

matplotlib.pyplot.gcf()[source]#

Get the current figure.

If there is currently no figure on the pyplot figure stack, a new one is created using figure(). (To test whether there is currently a figure on the pyplot figure stack, check whether get_fignums()is empty.)