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

Function fignum_exists

lib/matplotlib/pyplot.py:1165–1183  ·  view source on GitHub ↗

Return whether the figure with the given id exists. Parameters ---------- num : int or str A figure identifier. Returns ------- bool Whether or not a figure with id *num* exists.

(num: int | str)

Source from the content-addressed store, hash-verified

1163
1164
1165def fignum_exists(num: int | str) -> bool:
1166 """
1167 Return whether the figure with the given id exists.
1168
1169 Parameters
1170 ----------
1171 num : int or str
1172 A figure identifier.
1173
1174 Returns
1175 -------
1176 bool
1177 Whether or not a figure with id *num* exists.
1178 """
1179 return (
1180 _pylab_helpers.Gcf.has_fignum(num)
1181 if isinstance(num, int)
1182 else num in get_figlabels()
1183 )
1184
1185
1186def _raise_if_figure_exists(num, func_name, clear=False):

Callers 2

_raise_if_figure_existsFunction · 0.85
matshowFunction · 0.85

Calls 2

get_figlabelsFunction · 0.85
has_fignumMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…