Repository navigation
FIX: update scale on shared axes - #4709
Conversation
Fixes matplotlib#4450 Or at least the scary part of the scale change not propagating to all shared axes.
|
👍 Will wait till tomorrow for other comments |
There was a problem hiding this comment.
Does get_siblings() return itself along with siblings? If not, then doesn't the self axes miss out on updating?
There was a problem hiding this comment.
It does return it's self
There was a problem hiding this comment.
Also, do we have to watch out for possible infinite recursion?
There was a problem hiding this comment.
no, because this is reaching in and touching the inner bits of all of the axes axis, not coming through the ax.set_xscale method (which is where we would get recursion). My first attempt did use recursion, but I think this is simpler as we don't need the logic to prevent the infinite recursion.
|
👍 |
There was a problem hiding this comment.
Does this need to be called within the loop? I can't quite remember, but doesn't this method check the data limits for all the siblings anyway? We could improve the performance by calling this once for self and then explicitly setting the limits for the others, right?
There was a problem hiding this comment.
Yup, just checked:
if scalex and self._autoscaleXon:
xshared = self._shared_x_axes.get_siblings(self)
dl = [ax.dataLim for ax in xshared]
# ignore non-finite data limits if good limits exist
finite_dl = [d for d in dl if np.isfinite(d).all()]
if len(finite_dl):
dl = finite_dl
So, with this design, there is a potential for a huge performance hit, even for moderately sized plot grids.
`autoscale_view` already looks at siblings, only call it once.
|
I have fixed the quadruple calling, but now the ordering of |
|
Yeah, I think changing up the order is fine. The transforms stack doesn't care about limits, so |
FIX: update scale on shared axes
Fixes #4450
Or at least the scary part of the scale change not propagating
to all shared axes.