matplotlib basemap colorbar exception : Given element not contained in the stack

MRAB python at mrabarnett.plus.com
Sun May 29 15:29:01 EDT 2022


On 2022-05-29 13:57, iMath wrote:
> please see the formated code at https://stackoverflow.com/questions/72423464/matplotlib-basemap-colorbar-exception-given-element-not-contained-in-the-stack

The problem might be that you're passing "ax=self.ax" when you create 
the basemap, and you have:

     self.ax = self.map_canvas.figure.subplots()

According to the docs, ".subplots" doesn't return the axes, it returns a 
_tuple_ of the figure and the axes.


More information about the Python-list mailing list