hi guys

I’m new here and sorry for my dumb question… but i really got confused about the numbering of subplot.

So here is the question from :

We are asked to create a figure that has two rows of subplots. It should have:

Question 2
use the plt.subplot() command to select the box in the first column of the second row (the one with a square in it). Plot parabola vs x in this box.
The bottom left subplot is the third subplot from a grid with 2 rows and 2 columns, so the command would be:

plt.subplot(2, 2, 3)

My confusion is, where does the ‘third’ comes from? I thought in a way that when counting the number, from top to bottom and from left to right, the subplot with the square in it should the the second one and hence the code should be:

plt.subplot(2, 2, 2)

Could anyone help me out? Thanks in advance:)

Welcome to the forums!
It’s not a dumb question at all. It can be a little confusing! :slight_smile:

plt.subplot takes three arguments: nrows, ncols, index.
Here, the index starts at 1 going left to right from the upper left.

And, official documentation:

1 Like

cheers lisa, i think i get it!

1 Like