I am trying to understand how Matplotlib plt.subplot
actually works.
Take the following code:
import pyplot as plt
fig = plt.figure()
plt.subplot(1,2,1)
plt.subplot(2,2,2)
plt.show()
This generates the required subplot as :
But now I want to add a seperate plot in the bottom right hand corner that is vacant in the picture.
For which I used the code.
plt.subplot(2,2,3)
This however does not work as intended and gives a weird plot like the following:
I would like to know why this happening and what I can do to rectify this. I know this is possible by using GridSpec
, but is it possible through just subplot?
Also how does subplot work in cases like:
plt.subplot(4,3,3)
That is what happens when I change the grid structure on the next call? I am unable to see what the display is after I add this line.