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
fig, axs = plt.subplots(2, 2, sharex=True, sharey=True)
for i in range(2):
for j in range(2):
axs[i, j].hist(np.arange(10) + 10 ** (i + j)) # widely varying scales
for ax in axs.flat:
ax.set_xscale("log")
plt.show()
The axes end up x-relim'd to the data limits of the last axes, hiding away the other histograms (that part seems vaguely related to #3481?).
Of course, one may think "just call set_xscale("log") on one of the axes and the others will follow, right?". But switching to a single call axs[0, 0].set_xscale("log") end up as an even worse disaster; the scaling is not changed on the other axes but the tick markers are.
the scale does not properly propagate. This one is a bit upsetting, I suspect what is happening is that the Axis locator and formatter is getting updated (as they are the same objects) but the transforms on the axes are not as the Axis objects are not shared. I have a clean way to fix this (PR coming)
the auto limit on shared axes only looks at the last axes (it probably does look at all of them, just independently and sense the shared axis means the Axis object backing each of them is the same object the limits on the last axes it looks at wins. As this works correctly with linear scales I suspect that the special case code for dealing with logs is broken (like much of the autoscaling with log). This is annoying, but can be fixed by manually setting the limits.
Activity
tacaswell commentedon Jul 16, 2015
There are two indepnedent problems here
Axislocator and formatter is getting updated (as they are the same objects) but the transforms on the axes are not as theAxisobjects are not shared. I have a clean way to fix this (PR coming)Axisobject backing each of them is the same object the limits on the last axes it looks at wins. As this works correctly with linear scales I suspect that the special case code for dealing with logs is broken (like much of the autoscaling with log). This is annoying, but can be fixed by manually setting the limits.FIX: update scale on shared axes
tacaswell commentedon Jul 17, 2015
Re opening this as #4709 only fixed one of two problems reported.
afvincent commentedon Nov 1, 2017
@tacaswell @anntzer Is this issue still active?
2edf1e3 seems to be the switching point between between some wrong behavior and something that looks OK to me:
mwe with dc13688

mwe with 2edf1e3

anntzer commentedon Nov 1, 2017
Indeed, the issue is fixed now.