1 import matplotlib.pyplot as plt
3 import matplotlib.gridspec as gridspec
5 fig = plt.figure(tight_layout=True)
6 gs = gridspec.GridSpec(2, 3)
8 ax = fig.add_subplot(gs[0, :])
9 ax.plot(np.arange(0, 1e6, 1000))
10 ax.set_ylabel('YLabel0')
11 ax.set_xlabel('XLabel0')
15 ax = fig.add_subplot(gs[1, i])
16 ax.plot(np.arange(1., 0., -0.1) * 2000.,
17 np.arange(1., 0., -0.1))
18 ax.set_ylabel('YLabel1 %d' % i)
19 ax.set_xlabel('XLabel1 %d' % i)
21 for tick in ax.get_xticklabels():
24 # same as fig.align_xlabels(); fig.align_ylabels()