Open anntzer opened 3 years ago
The issue is caused by the call self.set_array(EMPTY_IMAGE) in base_image_artist.py(70); EMPTY_IMAGE is an array with a single Nan entry At some point this calls vmin = self._density_vmin(array) in generic_density_artist.py(77) and this generates the warning.
I hope it can be fixed.
Any fix?
This is a numpy issue occuring in numpy\lib\nanfunctions.py https://github.com/numpy/numpy/blob/v1.26.0/numpy/lib/nanfunctions.py#L236-L361
Can suppress the warning by wrapping the code section causing the warning with a warning ignore statement. See this post: https://stackoverflow.com/questions/29688168/mean-nanmean-and-warning-mean-of-empty-slice
For example, the first example given in the README (using the 'scatter_density' method) currently emits
when run with numpy 1.20.1, matplotlib 3.3.0, mpl-scatter-density 0.7.