Skip to content

Commit

Permalink
Merge pull request #574 from xylar/fix-register-colormap
Browse files Browse the repository at this point in the history
Fix registering colormaps
  • Loading branch information
xylar authored Jul 3, 2024
2 parents ceef452 + b68cbb4 commit c309e1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda_package/dev-spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inpoly
jigsaw>=0.9.12
jigsawpy>=0.2.1
libnetcdf
matplotlib-base
matplotlib-base>=3.9.0
netcdf4
numpy>=2.0,<3.0
progressbar2
Expand Down
5 changes: 3 additions & 2 deletions conda_package/mpas_tools/viz/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from importlib.resources import files as imp_res_files
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.pyplot as plt
from matplotlib import colormaps


def register_sci_viz_colormaps():
Expand Down Expand Up @@ -43,5 +44,5 @@ def _read_xml_colormap(xmlFile, mapName):

def _register_colormap_and_reverse(mapName, cmap):
if mapName not in plt.colormaps():
plt.register_cmap(mapName, cmap)
plt.register_cmap('{}_r'.format(mapName), cmap.reversed())
colormaps.register(cmap=cmap, name=mapName)
colormaps.register(cmap=cmap.reversed(), name='{}_r'.format(mapName))
2 changes: 1 addition & 1 deletion conda_package/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ requirements:
- jigsawpy >=0.2.1
- libnetcdf
- netcdf-fortran
- matplotlib-base
- matplotlib-base >=3.9.0
- netcdf4
- numpy >=2.0,<3.0
- progressbar2
Expand Down
2 changes: 1 addition & 1 deletion conda_package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'cmocean',
'dask',
'inpoly',
'matplotlib',
'matplotlib >=3.9.0',
'netcdf4',
'numpy',
'progressbar2',
Expand Down

0 comments on commit c309e1f

Please sign in to comment.