8000 Merge pull request #7427 from tacaswell/enh_add_dashes_validator · matplotlib/matplotlib@7815788 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7815788

Browse files
authored
Merge pull request #7427 from tacaswell/enh_add_dashes_validator
ENH: validate dashes in prop_cycle
2 parents 814fff5 + 9ee5f8d commit 7815788

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def validate_hatch(s):
682682
raise ValueError("Unknown hatch symbol(s): %s" % list(unknown))
683683
return s
684684
validate_hatchlist = _listify_validator(validate_hatch)
685-
685+
validate_dashlist = _listify_validator(validate_nseq_float())
686686

687687
_prop_validators = {
688688
'color': _listify_validator(validate_color_for_prop_cycle,
@@ -701,6 +701,7 @@ def validate_hatch(s):
701701
'alpha': validate_floatlist,
702702
'marker': validate_stringlist,
703703
'hatch': validate_hatchlist,
704+
'dashes': validate_dashlist,
704705
}
705706
_prop_aliases = {
706707
'c': 'color& 849B #39;,

lib/matplotlib/tests/test_cycles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def test_valid_input_forms():
162162
ax.set_prop_cycle('color', np.array([[1, 0, 0],
163163
[0, 1, 0],
164164
[0, 0, 1]]))
165+
ax.set_prop_cycle('dashes', [[], [13, 2], [8, 3, 1, 3]])
165166
ax.set_prop_cycle(lw=[1, 2], color=['k', 'w'], ls=['-', '--'])
166167
ax.set_prop_cycle(lw=np.array([1, 2]),
167168
color=np.array(['k', 'w']),

0 commit comments

Comments
 (0)
0