Skip to content

Commit df2ac49

Browse files
NoyHananQuLogic
andcommitted
Update lib/matplotlib/rcsetup.py
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent f847d53 commit df2ac49

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"""
1515

1616
import ast
17-
import numbers
1817
from functools import lru_cache, reduce
1918
from numbers import Real
2019
import operator
@@ -730,7 +729,7 @@ def visit_Attribute(self, node):
730729
ignorecase=True)
731730

732731

733-
def validate_legend_loc(loc):
732+
def _validate_legend_loc(loc):
734733
"""
735734
Confirm that loc is a type which rc.Params["legend.loc"] supports.
736735
@@ -759,8 +758,7 @@ def validate_legend_loc(loc):
759758
if 0 <= loc <= 10:
760759
return loc
761760
if isinstance(loc, tuple):
762-
if len(loc) == 2 \
763-
and all(isinstance(e, numbers.Real) for e in loc):
761+
if len(loc) == 2 and all(isinstance(e, Real) for e in loc):
764762
return loc
765763
raise ValueError(f"{loc} is not a valid legend location.")
766764

@@ -1089,7 +1087,7 @@ def _convert_validator_spec(key, conv):
10891087

10901088
# legend properties
10911089
"legend.fancybox": validate_bool,
1092-
"legend.loc": validate_legend_loc,
1090+
"legend.loc": _validate_legend_loc,
10931091

10941092
# the number of points in the legend line
10951093
"legend.numpoints": validate_int,

0 commit comments

Comments
 (0)