File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1000,9 +1000,24 @@ def gcf() -> Figure:
10001000 return figure ()
10011001
10021002
1003- def fignum_exists (num : int ) -> bool :
1004- """Return whether the figure with the given id exists."""
1005- return _pylab_helpers .Gcf .has_fignum (num ) or num in get_figlabels ()
1003+ def fignum_exists (num : int | str ) -> bool :
1004+ """Return whether the figure with the given id exists.
1005+
1006+ Parameters
1007+ ----------
1008+ num : int or str
1009+ A figure identifier.
1010+
1011+ Returns
1012+ -------
1013+ bool
1014+ Whether or not a figure with id *num* exists.
1015+ """
1016+ return (
1017+ _pylab_helpers .Gcf .has_fignum (num )
1018+ if isinstance (num , int )
1019+ else num in get_figlabels ()
1020+ )
10061021
10071022
10081023def get_fignums () -> list [int ]:
You can’t perform that action at this time.
0 commit comments