Matplotlib 3.3 compatibility fixups by TomAugspurger · Pull Request #35393 · pandas-dev/pandas (original) (raw)

This comes from a change in MPL being stricter about set_xticks. This worked for matplotlib 3.2

import pandas as pd import matplotlib.pyplot as plt import string import numpy as np

fig, (ax1, ax2) = plt.subplots(ncols=2, sharex=True) ax1.boxplot([ np.array([1, 2, 3, 4]), np.array([1, 2, 3, 4]) ]) ax2.boxplot([ np.array([1, 2, 2, 3]), np.array([1, 2, 3, 4]) ])

ax1.set_xticklabels(['A', 'B'])

We set 2 x ticklabels despite there being 4.