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

2022-05-30 Thread iMath
在 2022年5月30日星期一 UTC+8 03:29:28, 写道:
> 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.
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-05-29 Thread 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.

--
https://mail.python.org/mailman/listinfo/python-list


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

2022-05-29 Thread iMath
please see the formated code at 
https://stackoverflow.com/questions/72423464/matplotlib-basemap-colorbar-exception-given-element-not-contained-in-the-stack
-- 
https://mail.python.org/mailman/listinfo/python-list