Fix containment and subslice optim. for steps.#6645
Merged
tacaswell merged 2 commits intomatplotlib:masterfrom Jul 12, 2016
Merged
Fix containment and subslice optim. for steps.#6645tacaswell merged 2 commits intomatplotlib:masterfrom
tacaswell merged 2 commits intomatplotlib:masterfrom
Conversation
matplotlib#6497 set the `_path` attribute of Line2D to the actually drawn path even if the drawstyle is `steps-*`; however containment tests and the subslice optimization for very long paths were not updated accordingly (see matplotlib#6615). This patch fixes the issues. Note that `contains` returns, 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.
| _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, |
Member
There was a problem hiding this comment.
Can you add a test image for this?
Remove duplicated test as well.
|
|
||
|
|
||
| @cleanup | ||
| def test_ls_ds_conflict(): |
Contributor
Author
There was a problem hiding this comment.
It is duplicated (see the lines just above).
Member
There was a problem hiding this comment.
Ah, that is a good reason to remove it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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.