Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7815788

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

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+2-1Lines 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',

‎lib/matplotlib/tests/test_cycles.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cycles.py
+1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.