Matplotlib, shift boxplots along x-axis?
问题 I am plotting multiple boxplots along two different axes. My code looks like: fig, (ax1, ax2) = plt.subplots(2, sharex=True, sharey=False) data_1 = [array1, array2, array3] ax1.boxplot(data_1, whis=[5,95], showfliers=True) data_2 = [array4, array5] ax2.boxplot(data_2, whis=[5,95], showfliers=True) ax2.set_xlim(0,4) This produces a plot (substituting in my actual data) that looks like: However, I would like the lower plot (on ax2) to shift to the right along the x-axis by one unit. That is, I