Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix containment and subslice optim. for steps. #6645
Conversation
mdboom
added the
needs_review
label
Jun 26, 2016
tacaswell
added this to the
2.1 (next point release)
milestone
Jun 29, 2016
tacaswell
commented on the diff
Jun 29, 2016
lib/matplotlib/lines.py
| @@ -693,8 +696,9 @@ def _transform_path(self, subslice=None): | ||
| """ | ||
| # Masked arrays are now handled by the Path class itself | ||
| if subslice is not None: | ||
| - _steps = self._path._interpolation_steps | ||
| - _path = Path(self._xy[subslice, :], _interpolation_steps=_steps) | ||
| + xy = STEP_LOOKUP_MAP[self._drawstyle](*self._xy[subslice, :].T) | ||
| + _path = Path(np.asarray(xy).T, |
|
|
tacaswell
closed this
Jul 12, 2016
tacaswell
reopened this
Jul 12, 2016
tacaswell
added needs_review and removed needs_review
labels
Jul 12, 2016
tacaswell
commented on the diff
Jul 12, 2016
tacaswell
merged commit 239e5f0
into matplotlib:master
Jul 12, 2016
tacaswell
removed the
needs_review
label
Jul 12, 2016
anntzer
deleted the
anntzer:drawstyle-index-and-subslice branch
Jul 12, 2016
This was referenced Jul 14, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anntzer commentedJun 26, 2016
#6497 set the
_pathattribute of Line2D to the actually drawn patheven if the drawstyle is
steps-*; however containment tests and thesubslice optimization for very long paths were not updated accordingly
(see #6615). This patch fixes the issues.
Note that
containsreturns, for events in a horizontal segment of a"steps-mid" drawstyle plot, the index of the point in the segment,
regardless of whether the event occured to the left or the right of
that point.