Skip to content

Commit 3f9e75e

Browse files
committed
Fix rcParams validator for dashes.
Valid dash-patterns are actually just lists of floats: ``` rcParams["lines.dashed_pattern"] = (1, None) plt.plot([1, 2], ls="--") ``` throws ``` TypeError: unsupported operand type(s) for +: 'float' and 'NoneType' ```
1 parent 5698325 commit 3f9e75e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def validate_hatch(s):
793793

794794

795795
validate_hatchlist = _listify_validator(validate_hatch)
796-
validate_dashlist = _listify_validator(validate_nseq_float(allow_none=True))
796+
validate_dashlist = _listify_validator(validate_floatlist)
797797

798798

799799
_prop_validators = {
@@ -1069,9 +1069,9 @@ def _convert_validator_spec(key, conv):
10691069
"lines.solid_joinstyle": validate_joinstyle,
10701070
"lines.dash_capstyle": validate_capstyle,
10711071
"lines.solid_capstyle": validate_capstyle,
1072-
"lines.dashed_pattern": validate_nseq_float(allow_none=True),
1073-
"lines.dashdot_pattern": validate_nseq_float(allow_none=True),
1074-
"lines.dotted_pattern": validate_nseq_float(allow_none=True),
1072+
"lines.dashed_pattern": validate_floatlist,
1073+
"lines.dashdot_pattern": validate_floatlist,
1074+
"lines.dotted_pattern": validate_floatlist,
10751075
"lines.scale_dashes": validate_bool,
10761076

10771077
# marker props

0 commit comments

Comments
 (0)