-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
xlim_changed not emitted on shared axis #15785
Copy link
Copy link
Closed
Labels
Good first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!status: has patchpatch suggested, PR still neededpatch suggested, PR still neededtopic: axes
Milestone
Metadata
Metadata
Assignees
Labels
Good first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!status: has patchpatch suggested, PR still neededpatch suggested, PR still neededtopic: axes
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug report
Bug summary
When an axis is shared with another its registered "xlim_changed" callbacks does not get called when the change is induced by a shared axis (via sharex=).
In _base.py the set_xlim for sibling axis are called with emit=False:
I'm very new to matplotlib, so perhaps there is a good reason for this? emit=False seems to disable both continued "inheritance" of axis (why?) and triggering of change callbacks (looking at the code above).
It seems like one would at least want to trigger the xlim_changed callbacks as they would be intended to react to any change in axis limits.
Edit: Setting emit=True seems to introduce a recursion issue (not sure why but as inheritance seems to be passed along anyway it doesn't really matter). Moving the callback call to outside of the "if emit:"-statement seems to solve the issue as far as I can see when trying it out. Any reason to keep it inside the if-statement?