Only adjust the distance between two recharges in matplotlib

I have 3 subheadings (3 rows and 1 column). We can use fig.subplots_adjust(hspace=0.2) to adjust the distance between the subheadings. this will change the distance between the subheadings for the entire case. How can I distinguish between the distance between graph 1 (311) and graph 2 (312), as well as graph 2 (312) and graph 3 (313)?

+6
source share
1 answer
Good question. Try the following:
 from mpl_toolkits.axes_grid1 import make_axes_locatable ax1 = plt.subplot2grid((1,1), (0,0)) divider = make_axes_locatable(ax1) ax2 = divider.append_axes("bottom", size="100%", pad=0.5) ax3 = divider.append_axes("bottom", size="100%", pad=1) 

Then you will get:

enter image description here

+7
source

All Articles