Skip to content

Require non-zero dash value #22569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2022
Merged
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
8 changes: 6 additions & 2 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,8 @@ def set_dashes(self, dash_offset, dash_list):
dash_offset : float
The offset (usually 0).
dash_list : array-like or None
The on-off sequence as points. None specifies a solid line.
The on-off sequence as points. None specifies a solid line. All
values must otherwise be non-negative (:math:`\\ge 0`).

Notes
-----
Expand All @@ -924,7 +925,10 @@ def set_dashes(self, dash_offset, dash_list):
dl = np.asarray(dash_list)
if np.any(dl < 0.0):
raise ValueError(
"All values in the dash list must be positive")
"All values in the dash list must be non-negative")
if 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

def set_foreground(self, fg, isRGBA=False):
Expand Down