Aim - To make a 2×2 grid with lower row being occupied entirely by one axis.
Code till now: -
fig=plt.figure(figsize=[10,10])
ax0=fig.add_subplot(221)
ax0.scatter(xlist[:10],ylist[:10],color='red')
ax1=fig.add_subplot(222)
ax1.scatter(xlist[10:],ylist[10:],color='green')
ax3=fig.add_subplot(223)
ax3.scatter(xlist,ylist)
I want the ax3
to occupy the two lower spots in the 2nd row. I've a solution involving GridSpec
, however I want to avoid GridSpec
for now. This answer has answered it already. But I can't understand how plt.subplot(212)
makes it work the way I want. How can he put a (212) in a (2×2) grid. I was told that (223) indicates 3rd position in a 2×2 grid. So how can (212) be valid there?
Any help?
Note : - The Gridspec
method uses ax2=fig.add_subplot(gs[:1])
to put ax2
at both [0,1] and [1,1] positions.