MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / gcf

Function gcf

lib/matplotlib/pyplot.py:1149–1162  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1147
1148
1149def gcf() -> Figure:
1150 """
1151 Get the current figure.
1152
1153 If there is currently no figure on the pyplot figure stack, a new one is
1154 created using `~.pyplot.figure()`. (To test whether there is currently a
1155 figure on the pyplot figure stack, check whether `~.pyplot.get_fignums()`
1156 is empty.)
1157 """
1158 manager = _pylab_helpers.Gcf.get_active()
1159 if manager is not None:
1160 return manager.canvas.figure
1161 else:
1162 return figure()
1163
1164
1165def fignum_exists(num: int | str) -> bool:

Callers 15

findobjFunction · 0.85
get_current_fig_managerFunction · 0.85
connectFunction · 0.85
disconnectFunction · 0.85
clfFunction · 0.85
drawFunction · 0.85
savefigFunction · 0.85
figlegendFunction · 0.85
axesFunction · 0.85
subplotFunction · 0.85
subplot2gridFunction · 0.85
subplot_toolFunction · 0.85

Calls 2

figureFunction · 0.85
get_activeMethod · 0.45

Tested by

no test coverage detected