Skip to content

Commit 616efcf

Browse files
committed
Merge pull request matplotlib#1999 from mdboom/dashes-infinite-loop
Setting dashes to (0,0) results in infinite loop for agg backends
2 parents 2e7399e + b8a0dcf commit 616efcf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,10 @@ def set_dashes(self, dash_offset, dash_list):
872872
specifies the on-off sequence as points. ``(None, None)`` specifies a solid line
873873
874874
"""
875+
if dash_list is not None:
876+
dash_list = np.asarray(dash_list)
877+
if np.any(dash_list <= 0.0):
878+
raise ValueError("All values in the dash list must be positive")
875879
self._dashes = dash_offset, dash_list
876880

877881
def set_foreground(self, fg, isRGB=False):

0 commit comments

Comments
 (0)