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

Copy all internals from initial Tick to lazy ones#28577

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
ksunden merged 2 commits intomatplotlib:mainfromQuLogic:fix-tickdir
Aug 7, 2024

Conversation

QuLogic
Copy link
Member

PR summary

Ticks will follow thercParams at the time of their creation, if there were no other settings used. If thercParams are set in a context, then the lazily-generated ticks may start fetching the wrong values. This is fixed viaAxis._copy_tick_props by copying the properties from theTick's childArtist's to the new ones. However, internal attributes fromTick are not copied, which is generally fine for drawing because nothing is every re-synced from there.

However, in the case ofSpine's window extent, it is generated from the tick direction and size attributes on theTick, so being out of sync may cause an incorrect bounding box if the tick direction changes. SinceSpine chooses a randomTick, this will cause tight/constrained layout to be nondeterministic.

Since this is nondeterministic, I'm debating how best to write a test.

Fixes#28574.

PR checklist

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

Great detective work!

@timhoffm
Copy link
Member

@QuLogic decide yourself if / how to test this. May self-merge, then.

This is used only for XTick._apply_tickdir, and YTick._apply_tickdiruses a different dictionary.
@QuLogic
Copy link
MemberAuthor

I wasn't able to find a good way to test the layout portion directly, so I went with the more straightforward, though perhaps tautological, version of just asserting the copied attributes.

I also made one more change of adding adest.update_from(src) so that the main tick properties are copied. I don't believe we use any of them, but this is just in case that happens in the future.

@ksundenksunden added this to thev3.9.2 milestoneAug 7, 2024
@ksundenksunden merged commit3d37d7a intomatplotlib:mainAug 7, 2024
42 of 44 checks passed
@QuLogicQuLogic deleted the fix-tickdir branchAugust 7, 2024 20:48
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestAug 7, 2024
oscargus added a commit that referenced this pull requestAug 8, 2024
…577-on-v3.9.xBackport PR#28577 on branch v3.9.x (Copy all internals from initial Tick to lazy ones)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

[Bug]: Nondeterministic behavior with subplot spacing and constrained layout
4 participants
@QuLogic@timhoffm@jklymak@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp