You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plt.subplot eats my subplots. But it doesn't completely digest them, since they are still there, just not shown.
Creating a subplot grid with plt.subplots and in addition adding a plt.subplot removes those subplots from the grid, which are under the newly created subplot.
Creating the additional subplot via fig.add_subplot does not remove them.
I am currently looking at and editing those docstrings and that behavior is correct according to the docstrings and code. plt.subplot delete overlapping subplots and fig.add_subplot doesn't.
Activity
fredrik-1 commentedon Jun 13, 2018
I am currently looking at and editing those docstrings and that behavior is correct according to the docstrings and code.
plt.subplotdelete overlapping subplots andfig.add_subplotdoesn't.I don't know why it is a difference in behavior.
ImportanceOfBeingErnest commentedon Jun 13, 2018
So you think this is desired? That feels a lot as if suddenly
plt.titlewould create a title below the axes whileax.set_titlecreates it above or so.fredrik-1 commentedon Jun 13, 2018
I don't understand why the feature exist but it is well documented https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.subplot.html#matplotlib.pyplot.subplot
ImportanceOfBeingErnest commentedon Jun 13, 2018
I see. My bad. I guess this can be closed, although I think this pretty annoying and should probably be changed at some point.
jklymak commentedon Jun 13, 2018
Matlab does this...
anntzer commentedon Jun 13, 2018
We can't blame everything on MATLAB, see #7377 (comment) and surrounding discussion (I haven't tried for subplot though).
jklymak commentedon Jun 13, 2018
Again, I wouldn't use
plt.subplotsandplt.subplotin the same figure and expect anything sensible to happen.