from matplotlib.gridspec import GridSpec
# do not forget constrained_layout=True to have some space between axes
fig = plt.figure(constrained_layout=True)
gs = GridSpec(2, 2, figure=fig)
ax1 = fig.add_subplot(gs[0, :])
# identical to ax1 = plt.subplot(gs.new_subplotspec((0, 0), colspan=2))
ax2 = fig.add_subplot(gs[1, 0])
ax3 = fig.add_subplot(gs[1, 1])
plt.show()
1条答案
按热度按时间sycxhyv71#
我想你可以按照这个模式