I'm trying to make sense how the subplot indices work but they don't seem intuitive at all. I particularly have an issue with the third index. I know that there are other ways to create subplots in python but I am trying to understand how subplots written in such a manner work because they are used extensively.
I am trying to use a trivial example to see if I understand what I'm doing. So, here's what I want to do:
- Row 1 has 3 columns
- Row 2 has 2 columns
- Row 3 has 3 columns
- Rows 4 and 5 have 2 columns. However, I want to have the left subplot span rows 4 and 5.
This is the code for the first 3 rows. I don't understand why the third index of ax4
is 3 instead of 4.
ax1 = plt.subplot(5,3,1)
ax2 = plt.subplot(5,3,2)
ax3 = plt.subplot(5,3,3)
ax4 = plt.subplot(5,2,3)
ax5 = plt.subplot(5,2,4)
ax6 = plt.subplot(5,3,7)
ax7 = plt.subplot(5,3,8)
ax8 = plt.subplot(5,3,9)
For the three subplots that sit in rows 3 and 4, I can't seem to be able to do that. Here's my wrong attempt:
ax9 = plt.subplot(4,2,10)
ax10 = plt.subplot(5,2,12)
ax11 = plt.subplot(5,2,15)