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
PrevPrevious commit
NextNext commit
Fix case where axis limits are reversed
  • Loading branch information
@astrofrog@dhomeier
astrofrog authored anddhomeier committedJan 28, 2025
commitb7f12abd350d24aa1328f4aebcc5bf13c7a10be6
11 changes: 11 additions & 0 deletionslib/matplotlib/widgets.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3655,12 +3655,23 @@ def _clip_to_axes(self, x, y):

min_lim = (xlim[0], ylim[0])
max_lim = (xlim[1], ylim[1])

# Axes limits in display coordinates
min_lim = self.ax.transData.transform(min_lim)
max_lim = self.ax.transData.transform(max_lim)

# For axes where the limits are reversed, need to make sure the
# display min/max are in the correct order.

if min_lim[0] > max_lim[0]:
min_lim[0], max_lim[0] = max_lim[0], min_lim[0]

if min_lim[1] > max_lim[1]:
min_lim[1], max_lim[1] = max_lim[1], min_lim[1]

x = np.clip(x, min_lim[0], max_lim[0])
y = np.clip(y, min_lim[1], max_lim[1])

return x, y

# TODO: _draw_shape can be removed in 3.7
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp