Skip to content

Commit f5057f4

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 f5057f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)