Closed
Description
When plotting a lot of subplots (here 6), with long y-labels and tight_layout, the y-axis is reverted.
In this example, it is particularly striking as I am plotting histograms.
import matplotlib.pyplot as plt
import numpy as np
alphas = [0.001, 0.1, 1, 10, 1000, 10000]
X = np.random.randn(len(alphas), 1000)
fig, axes = plt.subplots(nrows=len(alphas), ncols=2)
fig.set_tight_layout(True)
for i, alpha in enumerate(alphas):
ax = axes[i, 0]
ax.hist(X[i])
ax.set_xlabel("Number of features", fontweight="bold")
ax.set_ylabel("Number of genes", fontweight="bold")
ax = axes[i, 1]
ax.plot(sorted(X[i]))
ax.set_ylabel("Number of genes", fontweight="bold")
Expected outcome
Removing the tight layout, the labels collapse, but at least the plots are oriented the correct way.
Matplotlib should either raise a proper error raise a proper warning, or plot the histograms in the proper order.
Matplotlib version
Matplotlib 2.0.0
Metadata
Metadata
Assignees
Labels
No labels