8000 shared axes switch to log scale · Issue #4450 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
shared axes switch to log scale #4450
Closed
@anntzer

Description

@anntzer

Consider

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0