Customising Matplotlib Subplots
I've always found matplotlib subplots confusing, and so I was wondering whether somebody could show how to generate the following arrangement of subplots: Subplot Image Thanks in a
Solution 1:
You can use plt.GridSpec to easily create differently sized subplots.
cols = 5#number of columns in the grids = 2#width of top right subplot in #cellsw = 1#spacing between subplot columnsfig = plt.figure()
gs = plt.GridSpec(2, cols, figure=fig, wspace=w)
ax1 = fig.add_subplot(gs[0, :-s])
ax2 = fig.add_subplot(gs[0, -s:])
ax3 = fig.add_subplot(gs[1, :-s])
Post a Comment for "Customising Matplotlib Subplots"