when using boxplot with matplotlib , I wouldlike to have the x ticks to adapt to the figure size, so that the x-axis is not completely unreadable
Example
import numpy as np
import matplotlib.pyplot as plt
x = np.random.uniform(size = (20, 50))
fig, ax = plt.subplots()
ax.boxplot(x, positions=np.arange(1, x.shape[1]+1))
which gives me
I expected the tick labels to adapt as for a regular plot, but apparently not. Any workarounds?


native_scale=Truewould give you a numeric x-axis.sns.boxplot(x, native_scale=True)example plot. Orsns.boxplot(pd.DataFrame(x, columns=np.arange(1, x.shape[1]+1)), native_scale=True)to start the numbering at 1.