Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions mpl_scatter_density/generic_density_artist.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

import numpy as np

from .color import make_cmap
Expand Down Expand Up @@ -49,8 +51,18 @@ class GenericDensityArtist(BaseImageArtist):
def __init__(self, ax, dpi=72, color=None, vmin=None, vmax=None, norm=None,
histogram2d_func=None, update_while_panning=True, **kwargs):

self._density_vmin = np.nanmin
self._density_vmax = np.nanmax
def nanmin(array):
with warnings.catch_warnings():
warnings.simplefilter("ignore", RuntimeWarning)
return np.nanmin(array)

def nanmax(array):
with warnings.catch_warnings():
warnings.simplefilter("ignore", RuntimeWarning)
return np.nanmax(array)

self._density_vmin = nanmin
self._density_vmax = nanmax

super(GenericDensityArtist, self).__init__(ax,
array_func=histogram2d_func,
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]

[tool.pytest.ini_options]
filterwarnings = [
"error"
]
Loading