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

iMath redstone-cold at 163.com
Mon May 30 02:41:35 EDT 2022


在 2022年5月30日星期一 UTC+8 03:29:28,<MRAB> 写道:
> 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.
Thanks for your reply ! But as I printed the value of self.ax , it is actually an instance of AxesSubplot.


More information about the Python-list mailing list