diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 03e3b05e927a..1eef95867743 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -461,8 +461,7 @@ def gcf(): return figure() def fignum_exists(num): - allLabels = get_figlabels() - return _pylab_helpers.Gcf.has_fignum(num) or num in allLabels + return _pylab_helpers.Gcf.has_fignum(num) or num in get_figlabels() def get_fignums():