I want to plot data, in two different subplots. After plotting, I want to go back to the first subplot and plot an additional dataset in it. However, when I do so I get this
Note that in this case, the warning is a false positive. It should ideally not be triggered in the case you use plt.subplot(..)
to reactivate a subplot which has previously been created.
The reason this warning occurs is that plt.subplot
and fig.add_subplot()
take the same code path internally. The warning is meant for the latter, but not the former.
To read more about this, see issues 12513. Long story short, people are working on it, but it is not as easy as initially thought to decouple the two functions. For the moment you can just savely ignore the warning if it is triggered by plt.subplot()
.