Matplotlib/Pyplot shared axis for odd number of subplots
问题 I am using the following code to produce an odd number of plots that I want 'butted' together and sharing axes. import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(4,2,1) ax1.set_yscale('log') ax1.set_xscale('log') plt.subplot(4,2,2, sharex=ax1, sharey=ax1) plt.subplot(4,2,3, sharex=ax1, sharey=ax1) plt.subplot(4,2,4, sharex=ax1, sharey=ax1) plt.subplot(4,2,5, sharex=ax1, sharey=ax1) plt.subplot(4,2,6, sharex=ax1, sharey=ax1) plt.subplot(4,2,7, sharex=ax1, sharey=ax1) plt