You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the grouper class attribute Axes._shared_axes['x']. The grouper stores the shared axes in a list without a hierarchy.
in the _sharex attribute of Axes. This is asymmetic in that the only one of the Axes gets the _sharex attribute set, resulting in a parent-child relation.
I think a reasonable incremental improvement would be to remove the Axes._sharex/y state. It's only used in very few places and can more reasonably be handled via the grouper Axes._shared_axes['x'].
Still to be clarified: Do we need the parent-child relation in any way? - From a quick look I don't think so.
Hi @timhoffm
I'm new here and i had started with understanding the axes functionality and found this issue relevant.
I was looking at all places where we're using _sharex and _sharey , I have some questions to help myself better understand. I've compiled all existing occurences and proposed change along with any doubts i have.
1 in axes\_base.py in the _AxesBase class
inside sharex() (similar for sharey())
ifself._sharexisnotNoneandotherisnotself._sharex:
raiseValueError("x-axis is already shared")
self._shared_axes["x"].join(self, other)
self._sharex=other
we are enforcing an assymetric relation here but it is not serving any purpose. We could very well use the grouper DSU to just join them.
we are restoring previous visibility config if there is axis sharing , imo this is equivalent to checking if it has any siblings using the grouper.
But even if _sharex = None , there still can be shared axis but being refernced by the other axes obj's _sharex attr.
I dont think this is intended but maybe im not understanding correctly.
Activity
[-][MNT]: Consolidate sharing logic[/-][+][MNT]: Consolidate axis sharing logic[/+]tamrind69 commentedon Oct 30, 2026
Hi @timhoffm
I'm new here and i had started with understanding the axes functionality and found this issue relevant.
I was looking at all places where we're using
_sharexand_sharey, I have some questions to help myself better understand. I've compiled all existing occurences and proposed change along with any doubts i have.1 in
axes\_base.pyin the_AxesBaseclassinside
sharex()(similar forsharey())we are enforcing an assymetric relation here but it is not serving any purpose. We could very well use the grouper DSU to just join them.
in
_clear()we are restoring previous visibility config if there is axis sharing , imo this is equivalent to checking if it has any siblings using the grouper.
But even if
_sharex = None, there still can be shared axis but being refernced by the other axes obj's_sharexattr.I dont think this is intended but maybe im not understanding correctly.
2 in
mpl_toolkits\parasite_axes.py'in
HostAxesBaseclassthe
_sharexand_shareychecks are equivalent to checking whether the host exists as a sibling byax._shared_axes["x"/"y"].get_siblings(ax).I apologize for any naiveness on my part. I'd like to work on this if possible.
tamrind69 commentedon Nov 2, 2026
Hi @timhoffm . Apologies for another ping but is this open to work on? I'd like to submit a pr
thankyou