Permalink
Browse files

Fix #1999: dash value of zero causes infinite loop

  • Loading branch information...
1 parent 2e7399e commit b8a0dcf308dec9bc1dc90bbebf54611f56c781d6 @mdboom committed May 13, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/matplotlib/backend_bases.py
@@ -872,6 +872,10 @@ def set_dashes(self, dash_offset, dash_list):
specifies the on-off sequence as points. ``(None, None)`` specifies a solid line
"""
+ if dash_list is not None:
+ dash_list = np.asarray(dash_list)
+ if np.any(dash_list <= 0.0):
+ raise ValueError("All values in the dash list must be positive")
self._dashes = dash_offset, dash_list
def set_foreground(self, fg, isRGB=False):

0 comments on commit b8a0dcf

Please sign in to comment.