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

Add corner coordinate helper methods to Ellipse/Rectangle#21977

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
QuLogic merged 1 commit intomatplotlib:mainfromdstansby:patch-helpers
Jan 5, 2022

Conversation

dstansby
Copy link
Member

PR Summary

This is pulled out of#21945 because it's a standalone feature, and I think it's worth the scrutiny of a separate PR.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@dstansbydstansby added this to thev3.6.0 milestoneDec 16, 2021
Copy link
Member

@ericpreericpre left a comment

Choose a reason for hiding this comment

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

It would be good to add a test with rotation.

@dstansbydstansbyforce-pushed thepatch-helpers branch 3 times, most recently from09dd9aa tof155550CompareDecember 17, 2021 13:05
@dstansby
Copy link
MemberAuthor

Sorry for the messy PR... I've dropped edge_centers (I'll add them as private API in the widget PR), and should have resolved all the other comments.

def get_corners(self):
"""
Return the corners of the ellipse bounding box, moving anti-clockwise
from the lower left.
Copy link
Member

Choose a reason for hiding this comment

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

Is it really lower left? Can'tangle be over 90?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, it's lower left in the de-rotated frame. I'm not sure what the best way to phrase this is - perhaps just "from the lower left before rotation is applied."?

Copy link
Member

Choose a reason for hiding this comment

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

Would it better and clear enough to use "anchor point" (xy), as this term is used in theRectangle patch docstring?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't think that works forEllipse though, since the "anchor point" is the center.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, it isn't sensible for theEllipse patch - sorry I read too quickly!
Is it worth having aget_corners property as public API for theEllipse patch? Maybe there could a private API_get_corners for both (Rectangle andEllipse) andRectangle patch could have the publicget_corners as a convenience property?

@dstansbydstansby changed the titleAdd corner/edge coordinate helpers methods to Ellipse/RectangleAdd corner coordinate helper methods to Ellipse/RectangleDec 19, 2021
Copy link
Member

@ericpreericpre left a comment

Choose a reason for hiding this comment

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

#21977 (comment) could be improved but this is already good.

@QuLogicQuLogic merged commit6a74631 intomatplotlib:mainJan 5, 2022
@dstansbydstansby deleted the patch-helpers branchJanuary 5, 2022 22:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm left review comments

@QuLogicQuLogicQuLogic approved these changes

@ericpreericpreericpre approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

5 participants
@dstansby@QuLogic@timhoffm@ericpre@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp