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 @@ -999,9 +999,24 @@ def gcf() -> Figure:
999
999
return figure ()
1000
1000
1001
1001
1002
- def fignum_exists (num : int ) -> bool :
1003
- """Return whether the figure with the given id exists."""
1004
- return _pylab_helpers .Gcf .has_fignum (num ) or num in get_figlabels ()
1002
+ def fignum_exists (num : int | str ) -> bool :
1003
+ """Return whether the figure with the given id exists.
1004
+
1005
+ Parameters
1006
+ ----------
1007
+ num : int or str
1008
+ A figure identifier.
1009
+
1010
+ Returns
1011
+ -------
1012
+ bool
1013
+ Whether or not a figure with id *num* exists.
1014
+ """
1015
+ return (
1016
+ _pylab_helpers .Gcf .has_fignum (num )
1017
+ if isinstance (num , int )
1018
+ else num in get_figlabels ()
1019
+ )
1005
1020
1006
1021
1007
1022
def get_fignums () -> list [int ]:
You can’t perform that action at this time.
0 commit comments