From df5df2e15fee65f98ce4900072cf071f2959f4b2 Mon Sep 17 00:00:00 2001 From: Mad Physicist Date: Sun, 13 Mar 2016 23:09:24 -0400 Subject: [PATCH] Bug: Fixed regression of `drawstyle=None` --- lib/matplotlib/lines.py | 2 ++ lib/matplotlib/tests/test_lines.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 9f8ba7a653f..3b2631a47ab 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -985,6 +985,8 @@ def set_drawstyle(self, drawstyle): ACCEPTS: ['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post'] """ + if drawstyle is None: + drawstyle = 'default' if drawstyle not in self.drawStyles: raise ValueError('Unrecognized drawstyle ' + ' '.join(self.drawStyleKeys)) diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py index dc0b1f7b461..f63689a4db3 100644 --- a/lib/matplotlib/tests/test_lines.py +++ b/lib/matplotlib/tests/test_lines.py @@ -123,7 +123,7 @@ def test_drawstyle_variants(): fig = plt.figure() ax = fig.add_subplot(1, 1, 1) for ds in ("default", "steps-mid", "steps-pre", "steps-post", - "steps"): + "steps", None): ax.plot(range(10), drawstyle=ds) fig.canvas.draw()