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

Skip to content

Commit c489bff

Browse files
authored
Merge pull request matplotlib#6564 from anntzer/cleanup-drawstyles
MNT: Cleanup for drawstyles
2 parents 0d33b1f + b45fdde commit c489bff

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4732,7 +4732,7 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
47324732
y1slice = y1[ind0:ind1]
47334733
y2slice = y2[ind0:ind1]
47344734
if step is not None:
4735-
step_func = STEP_LOOKUP_MAP[step]
4735+
step_func = STEP_LOOKUP_MAP["steps-" + step]
47364736
xslice, y1slice, y2slice = step_func(xslice, y1slice, y2slice)
47374737

47384738
if not len(xslice):
@@ -4882,7 +4882,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
48824882
x1slice = x1[ind0:ind1]
48834883
x2slice = x2[ind0:ind1]
48844884
if step is not None:
4885-
step_func = STEP_LOOKUP_MAP[step]
4885+
step_func = STEP_LOOKUP_MAP["steps-" + step]
48864886
yslice, x1slice, x2slice = step_func(yslice, x1slice, x2slice)
48874887

48884888
if not len(yslice):

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ def get_icon(name):
3333
'none': 'None',
3434
}
3535

36-
DRAWSTYLES = {'default': 'Default',
37-
'steps': 'Steps',
38-
}
36+
DRAWSTYLES = {
37+
'default': 'Default',
38+
'steps-pre': 'Steps (Pre)', 'steps': 'Steps (Pre)',
39+
'steps-mid': 'Steps (Mid)',
40+
'steps-post': 'Steps (Post)'}
3941

4042
MARKERS = markers.MarkerStyle.markers
4143

lib/matplotlib/cbook.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,10 +2394,8 @@ def pts_to_midstep(x, *args):
23942394
# convert 2D array back to tuple
23952395
return tuple(steps)
23962396

2397+
23972398
STEP_LOOKUP_MAP = {'default': lambda x, y: (x, y),
2398-
'pre': pts_to_prestep,
2399-
'post': pts_to_poststep,
2400-
'mid': pts_to_midstep,
24012399
'steps': pts_to_prestep,
24022400
'steps-pre': pts_to_prestep,
24032401
'steps-post': pts_to_poststep,

lib/matplotlib/lines.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,7 @@ def set_drawstyle(self, drawstyle):
986986
if drawstyle is None:
987987
drawstyle = 'default'
988988
if drawstyle not in self.drawStyles:
989-
raise ValueError('Unrecognized drawstyle ' +
990-
' '.join(self.drawStyleKeys))
989+
raise ValueError('Unrecognized drawstyle {!r}'.format(drawstyle))
991990
if self._drawstyle != drawstyle:
992991
self.stale = True
993992
self._drawstyle = drawstyle

0 commit comments

Comments
 (0)