Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great detective work!
@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.
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 a |
3d37d7a
intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
…577-on-v3.9.xBackport PR#28577 on branch v3.9.x (Copy all internals from initial Tick to lazy ones)
PR summary
Ticks will follow the
rcParams
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 of
Spine
'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