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

Factor out handling of missing spines in alignment calculations.#28313

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
timhoffm merged 1 commit intomatplotlib:mainfromanntzer:missing-spine
May 27, 2024

Conversation

anntzer
Copy link
Contributor

... by using spines.get.

Note that for an Axes, get_window_extent (with or without the renderer argument) is always equal to ax.bbox; the refactoring also makes that symmetry clearer.

Noted while looking at#28300.

PR summary

PR checklist

@rcomer

This comment was marked as outdated.

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

Take or leave my comments. You can self-merge.

@@ -2400,34 +2400,19 @@ def _update_label_position(self, renderer):
# get bounding boxes for this axis and any siblings
# that have been set by `fig.align_xlabels()`
bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)

ax = self.axes
Copy link
Member

Choose a reason for hiding this comment

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

This is only extracted to make l.2409 / l.2414 shorter. I would not do that because it separates definition and usage and thereby results in more state and thus cognitive load.

I slightly prefer to either leave this in placeself.axes.spines.get("bottom", self.axes) - or if that's reads too cumbersome, define it right before usage in each if branch.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I think the repetition of self.axes reads a bit cumbersome here, but sure, I put it back. Ditto below.

@@ -2641,33 +2626,19 @@ def _update_label_position(self, renderer):
# get bounding boxes for this axis and any siblings
# that have been set by `fig.align_ylabels()`
bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
ax = self.axes
Copy link
Member

Choose a reason for hiding this comment

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

As above.

... by using spines.get.Note that for an Axes, get_window_extent (with or without the rendererargument) is always equal to ax.bbox; the refactoring also makes thatsymmetry clearer.
@timhoffmtimhoffm added this to thev3.10.0 milestoneMay 27, 2024
@timhoffmtimhoffm merged commit2834da1 intomatplotlib:mainMay 27, 2024
41 of 42 checks passed
@anntzeranntzer deleted the missing-spine branchMay 27, 2024 18:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@rcomerrcomerrcomer approved these changes

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

Successfully merging this pull request may close these issues.

3 participants
@anntzer@rcomer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp