Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def set_dashes(self, dash_offset, dash_list):
if np.any(dl < 0.0):
raise ValueError(
"All values in the dash list must be non-negative")
if not np.any(dl > 0.0):
if dl.size and not np.any(dl > 0.0):
raise ValueError(
'At least one value in the dash list must be positive')
self._dashes = dash_offset, dash_list
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/tests/test_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def test_valid_colors():
def test_linestyle_variants():
fig, ax = plt.subplots()
for ls in ["-", "solid", "--", "dashed",
"-.", "dashdot", ":", "dotted"]:
"-.", "dashdot", ":", "dotted",
(0, None), (0, ()), (0, []), # gh-22930
]:
ax.plot(range(10), linestyle=ls)
fig.canvas.draw()

Expand Down