Iram Shahed
Iram Shahed

Reputation: 21

Adding Three subplots on Matplotlib 1 one on top pf the other

I am trying to make a graphing interface with 3 different graphs one on top of the other. i have so far

plt.subplot(2,1,1)

the top one

plt.subplot(2,1,2)

the second one

plt.subplot(2,1,3)

supposed to be the third one but keeps giving error

Upvotes: 1

Views: 2359

Answers (1)

Amy Teegarden
Amy Teegarden

Reputation: 3972

That's because the first number in subplot is the number of rows of plots (the second number is the number of columns). So the first number should be 3 every time you call plt.subplot.

Upvotes: 3

Related Questions