Skip to content

Commit 11842f7

Browse files
committed
Require non-zero dash value
1 parent c57c878 commit 11842f7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,8 @@ def set_dashes(self, dash_offset, dash_list):
912912
dash_offset : float
913913
The offset (usually 0).
914914
dash_list : array-like or None
915-
The on-off sequence as points. None specifies a solid line.
915+
The on-off sequence as points. None specifies a solid line. All
916+
values must otherwise be non-negative (>= 0).
916917
917918
Notes
918919
-----
@@ -924,7 +925,10 @@ def set_dashes(self, dash_offset, dash_list):
924925
dl = np.asarray(dash_list)
925926
if np.any(dl < 0.0):
926927
raise ValueError(
927-
"All values in the dash list must be positive")
928+
"All values in the dash list must be non-negative")
929+
if not np.any(dl > 0.0):
930+
raise ValueError(
931+
'At least one value in the dash list must be positive')
928932
self._dashes = dash_offset, dash_list
929933

930934
def set_foreground(self, fg, isRGBA=False):

0 commit comments

Comments
 (0)