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
Describe the bug
The Raster.show() method does not care about subplots, and also calls plt.show() which messes up any attempt to fix it! The easy solution is to add the ax keyword, but it is odd that ax does not default to plt.gca().
I like that plt.show() is called when no argument is given to img.show() so that one get a view of the raster in one line. But I think that would still prevent your first example unfortunately...
For info, it seems like geopandas also completely ignore the current axes too (so we can do better! 😉):
Incidentally, our current behaviour is far closer to that of seaborn and geopandas. Both of these seem to always ignore the current axes, you have to pass ax=myax to explicitly use an existing axis.
In any case, perhaps this isn't really a bug but more of a design choice?
Describe the bug
The
Raster.show()
method does not care about subplots, and also callsplt.show()
which messes up any attempt to fix it! The easy solution is to add theax
keyword, but it is odd thatax
does not default toplt.gca()
.To Reproduce
Steps to reproduce the behavior:
This is how to make it work correctly, but it is not easy for newcomers to understand why:
Expected behavior
One figure with two subplots should be created. This currently shows four plots; two empty subplots and two single raster plots.
The text was updated successfully, but these errors were encountered: