I'm using subplot2grid to define a grid of plots as shown below. Works great, it's a good functionality.
plot_axes_1 = plt.subplot2grid((6, 4), (0, 0), rowspan=2, colspan=3) ##1
plot_axes_2 = plt.subplot2grid((6, 4), (2, 0), rowspan=2, colspan=3, sharex=scatter_axes_1) ##2
x_hist_axes_2 = plt.subplot2grid((6, 4), (4, 0), colspan=3, sharex=scatter_axes_2) ##3
y_hist_axes_1 = plt.subplot2grid((6, 4), (0, 3), rowspan=2, sharey=scatter_axes_1) ##4
y_hist_axes_2 = plt.subplot2grid((6, 4), (2, 3), rowspan=2, sharey=scatter_axes_2, sharex= y_hist_axes_1) ##5
Now I want to consider the 5 plots from the image as a unit, and plot 6 copies of it, arranged on 3 rows and 2 columns.
fig, ax= plt.subplots(3,2)
for l in range(3):
for m in range(2):
ax[l,m].subplot2grid((6, 4), (0, 0), rowspan=2, colspan=3) ##1
ax[l,m].subplot2grid((6, 4), (2, 0), rowspan=2, colspan=3, sharex=scatter_axes_1) ##2
ax[l,m].subplot2grid((6, 4), (4, 0), colspan=3, sharex=scatter_axes_2) ##3
ax[l,m].subplot2grid((6, 4), (0, 3), rowspan=2, sharey=scatter_axes_1) ##4
ax[l,m].subplot2grid((6, 4), (2, 3), rowspan=2, sharey=scatter_axes_2, sharex= y_hist_axes_1) ##5
But I can't use subplot2grid like this, I get the error
'AxesSubplot' object has no attribute 'subplot2grid'
Is there another function I can use with AxesSubplot to do that?



