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

Improve RectangleSelector Rotation revisited and rebased#26833

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

Open
dhomeier wants to merge9 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromdhomeier:selector-rotation
Open
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Add edge midpoint helper methods
Co-authored-by: David Stansby <dstansby@gmail.com>
  • Loading branch information
@dhomeier@dstansby
dhomeier anddstansby committedJan 28, 2025
commit8063e15085d171381cbae53462eb971bebf42cd2
16 changes: 16 additions & 0 deletionslib/matplotlib/patches.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -877,6 +877,14 @@ def get_corners(self):
return self.get_patch_transform().transform(
[(0, 0), (1, 0), (1, 1), (0, 1)])

def _get_edge_midpoints(self):
"""
Return the edge midpoints of the rectangle, moving anti-clockwise from
the centre of the left-hand edge.
"""
return self.get_patch_transform().transform(
[(0, 0.5), (0.5, 0), (1, 0.5), (0.5, 1)])

def get_center(self):
"""Return the centre of the rectangle."""
return self.get_patch_transform().transform((0.5, 0.5))
Expand DownExpand Up@@ -1794,6 +1802,14 @@ def get_co_vertices(self):
ret = self.get_patch_transform().transform([(0, 1), (0, -1)])
return [tuple(x) for x in ret]

def _get_edge_midpoints(self):
"""
Return the edge midpoints of the ellipse, moving anti-clockwise from
the centre of the left-hand edge.
"""
return self.get_patch_transform().transform(
[(0, 0.5), (0.5, 0), (1, 0.5), (0.5, 1)])


class Annulus(Patch):
"""
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp