Skip to content

Commit dded75c

Browse files
Code review updates
1 parent 26650f8 commit dded75c

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

lib/matplotlib/cbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ def pts_to_midstep(x, *args):
16911691
return steps
16921692

16931693

1694-
STEP_LOOKUP_MAP = {'default': None, # Sentinel: use xy unchanged
1694+
STEP_LOOKUP_MAP = {'default': lambda x, y: (x, y),
16951695
'steps': pts_to_prestep,
16961696
'steps-pre': pts_to_prestep,
16971697
'steps-post': pts_to_poststep,

lib/matplotlib/collections.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,8 +1566,7 @@ def _make_verts_for_region(self, t, f1, f2, idx0, idx1):
15661566
f2_slice = f2[idx0:idx1]
15671567
if self._step is not None:
15681568
step_func = cbook.STEP_LOOKUP_MAP["steps-" + self._step]
1569-
if step_func is not None:
1570-
t_slice, f1_slice, f2_slice = step_func(t_slice, f1_slice, f2_slice)
1569+
t_slice, f1_slice, f2_slice = step_func(t_slice, f1_slice, f2_slice)
15711570

15721571
if self._interpolate:
15731572
start = self._get_interpolating_points(t, f1, f2, idx0)

lib/matplotlib/lines.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,10 @@ def recache(self, always=False):
709709
interpolation_steps = self._path._interpolation_steps
710710
else:
711711
interpolation_steps = 1
712-
step_func = STEP_LOOKUP_MAP[self._drawstyle]
713-
if step_func is None:
712+
if self._drawstyle == 'default':
714713
vertices = self._xy
715714
else:
715+
step_func = STEP_LOOKUP_MAP[self._drawstyle]
716716
vertices = np.asarray(step_func(*self._xy.T)).T
717717
self._path = Path(vertices, _interpolation_steps=interpolation_steps)
718718
self._transformed_path = None
@@ -727,10 +727,10 @@ def _transform_path(self, subslice=None):
727727
"""
728728
# Masked arrays are now handled by the Path class itself
729729
if subslice is not None:
730-
step_func = STEP_LOOKUP_MAP[self._drawstyle]
731-
if step_func is None:
730+
if self._drawstyle == 'default':
732731
vertices = self._xy[subslice]
733732
else:
733+
step_func = STEP_LOOKUP_MAP[self._drawstyle]
734734
vertices = np.asarray(step_func(*self._xy[subslice, :].T)).T
735735
_path = Path(vertices,
736736
_interpolation_steps=self._path._interpolation_steps)

lib/matplotlib/transforms.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,6 @@ def update_from_path(self, path, ignore=None, updatex=True, updatey=True):
901901

902902
valid_points = (np.isfinite(path.vertices[..., 0])
903903
& np.isfinite(path.vertices[..., 1]))
904-
if not valid_points.any():
905-
return
906904

907905
if updatex:
908906
x = path.vertices[..., 0][valid_points]

0 commit comments

Comments
 (0)