Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 196f344

Browse files
committed
Merge pull request #6156 from madphysicist/patch-1
Bug: Fixed regression of `drawstyle=None`
2 parents 455cb92 + df5df2e commit 196f344

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
@@ -985,6 +985,8 @@ def set_drawstyle(self, drawstyle):
985985
ACCEPTS: ['default' | 'steps' | 'steps-pre' | 'steps-mid' |
986986
'steps-post']
987987
"""
988+
if drawstyle is None:
989+
drawstyle = 'default'
988990
if drawstyle not in self.drawStyles:
989991
raise ValueError('Unrecognized drawstyle ' +
990992
' '.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)