Skip to content

Commit

Permalink
Fix matplotlib#1999: dash value of zero causes infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed May 13, 2013
1 parent 2e7399e commit b8a0dcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/matplotlib/backend_bases.py
Expand Up @@ -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 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 self._dashes = dash_offset, dash_list


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

0 comments on commit b8a0dcf

Please sign in to comment.