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

Emit xlim_changed on shared axes.#26011

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
QuLogic merged 1 commit intomatplotlib:mainfromanntzer:xcs
Jul 28, 2023
Merged

Conversation

anntzer
Copy link
Contributor

PR summary

Closes#15785 (see#15785 (comment)).

PR checklist

for other in self._get_shared_axes():
if other is not self.axes:
other._axis_map[name]._set_lim(
v0, v1, emit=False, auto=auto)
Copy link
Member

Choose a reason for hiding this comment

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

could this just be solved with the one line change of:

# Emit callbacks on shared axes without recursingother.callbacks.process(f"{name}lim_changed",other)

inside of this for loop/if condition

seems overdesigned to introduce undocumented sentinel behavior to get one line to run.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Ah yes, that'smuch better.

Comment on lines +1235 to +1248
if emit:
other.callbacks.process(f"{name}lim_changed", other)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ifemit:
other.callbacks.process(f"{name}lim_changed",other)
other.callbacks.process(f"{name}lim_changed",other)

This if will never be false as it is guarded by the sameif emit: on line 1228 (with no overwriting of the variable.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

True, but I think guarding the shared-axes syncing withif emit: is actually wrong (#26085), whereas the extraif emit: here is correct, so perhaps let's keep it there so that we don't forget to put it in when removing the outer check?

Copy link
Member

Choose a reason for hiding this comment

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

I was wondering a bit about that behavior, but didn't take the time to actually test it...

Could it be as simple as dedenting the for loop (and keeping this if)?

That would:

  • call the code to actually update the shared axes, regardless ofemit
  • makeemit truly only tied to the callback behavior, which is what I would expect

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Dedenting the for loopwill lead to infinite recursion, so that will need some kind of marker to block recursion (but it can't be done by overloading the semantics of emit as I proposed initially...).

@ksundenksunden added this to thev3.8.0 milestoneJul 27, 2023
@QuLogicQuLogic reopened thisJul 27, 2023
@QuLogicQuLogic merged commit0dc8c2f intomatplotlib:mainJul 28, 2023
@anntzeranntzer deleted the xcs branchJuly 28, 2023 05:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@ksundenksundenksunden approved these changes

@oscargusoscargusoscargus approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.8.0
Development

Successfully merging this pull request may close these issues.

xlim_changed not emitted on shared axis
4 participants
@anntzer@QuLogic@ksunden@oscargus

[8]ページ先頭

©2009-2025 Movatter.jp