Skip to content

Commit

Permalink
MAINT: fix PendingDeprecationWaring in matplotlib colormap access
Browse files Browse the repository at this point in the history
  • Loading branch information
leloup314 committed Nov 7, 2022
1 parent 35078e2 commit 4d49318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions online_monitor/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from importlib import import_module
from inspect import getmembers, isclass
from online_monitor.utils import settings
from matplotlib.cm import get_cmap
from matplotlib import colormaps
from copy import copy

# Installing blosc can be troublesome under windows, thus do not requiere it
Expand All @@ -26,7 +26,7 @@

def lut_from_colormap(cm_name='viridis'):
# https://github.com/pyqtgraph/pyqtgraph/issues/561
colormap = copy(get_cmap(cm_name))
colormap = copy(colormaps[cm_name])
colormap._init()
return (colormap._lut[:-3] * 255).astype(np.uint8)

Expand Down

0 comments on commit 4d49318

Please sign in to comment.