Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix containment and subslice optim. for steps.#6645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

anntzer
Copy link
Contributor

#6497 set the_path attribute of Line2D to the actually drawn path
even if the drawstyle issteps-*; however containment tests and the
subslice optimization for very long paths were not updated accordingly
(see#6615). This patch fixes the issues.

Note thatcontains 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.

matplotlib#6497 set the `_path` attribute 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(seematplotlib#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 ofthat point.
@tacaswelltacaswell added this to the2.1 (next point release) milestoneJun 29, 2016
_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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add a test image for this?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

Remove duplicated test as well.
@@ -4460,12 +4460,6 @@ def test_ls_ds_conflict():
linestyle='steps-pre:', drawstyle='steps-post')


@cleanup
def test_ls_ds_conflict():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why remove this?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is duplicated (see the lines just above).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah, that is a good reason to remove it.

@tacaswelltacaswell merged commit239e5f0 intomatplotlib:masterJul 12, 2016
@anntzeranntzer deleted the drawstyle-index-and-subslice branchJuly 12, 2016 16:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@tacaswell@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp