From b8a0dcf308dec9bc1dc90bbebf54611f56c781d6 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 13 May 2013 17:46:37 -0400 Subject: [PATCH] Fix #1999: dash value of zero causes infinite loop --- lib/matplotlib/backend_bases.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 52190fe0295f..e950ea335a8f 100644 --- a/lib/matplotlib/backend_bases.py +++ b/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):