Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8a0dcf

Browse files
committed
Fix #1999: dash value of zero causes infinite loop
1 parent 2e7399e commit b8a0dcf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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)