8000 Merge pull request #6156 from madphysicist/patch-1 · matplotlib/matplotlib@2b20939 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b20939

Browse files
committed
Merge pull request #6156 from madphysicist/patch-1
Bug: Fixed regression of `drawstyle=None`
1 parent e738593 commit 2b20939

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/matplotlib/lines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,8 @@ def set_drawstyle(self, drawstyle):
986986
ACCEPTS: ['default' | 'steps' | 'steps-pre' | 'steps-mid' |
987987
'steps-post']
988988
"""
989+
if drawstyle is None:
990+
drawstyle = 'default'
989991
if drawstyle not in self.drawStyles:
990992
raise ValueError('Unrecognized drawstyle ' +
991993
' '.join(self.drawStyleKeys))

lib/matplotlib/tests/test_lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_drawstyle_variants():
123123
fig = plt.figure()
124124
ax = fig.add_subplot(1, 1, 1)
125125
for ds in ("default", "steps-mid", "steps-pre", "steps-post",
126-
"steps"):
126+
"steps", None):
127127
ax.plot(range(10), drawstyle=ds)
128128

129129
fig.canvas.draw()

0 commit comments

Comments
 (0)
0