99import matplotlib .colors as cols
1010import matplotlib .pyplot as plt
1111import uxarray as ux
12+ from matplotlib import cm
1213from mpl_toolkits .axes_grid1 .inset_locator import inset_axes
1314from pyremap .descriptor .utility import interp_extrap_corner
1415
@@ -81,6 +82,13 @@ def plot_global_mpas_field(mesh_filename, da, out_filename, config,
8182 projection = cartopy .crs .PlateCarree (central_longitude = central_longitude )
8283
8384 colormap = config .get (colormap_section , 'colormap_name' )
85+ cmap = cm .get_cmap (colormap )
86+ if config .has_option (colormap_section , 'under_color' ):
87+ under_color = config .get (colormap_section , 'under_color' )
88+ cmap .set_under (under_color )
89+ if config .has_option (colormap_section , 'over_color' ):
90+ over_color = config .get (colormap_section , 'over_color' )
91+ cmap .set_over (over_color )
8492
8593 norm_type = config .get (colormap_section , 'norm_type' )
8694 if norm_type == 'linear' :
@@ -94,7 +102,7 @@ def plot_global_mpas_field(mesh_filename, da, out_filename, config,
94102 dtype = float )
95103
96104 plot = gdf_data .hvplot .polygons (
97- c = da .name , cmap = colormap , logz = logz ,
105+ c = da .name , cmap = cmap , logz = logz ,
98106 clim = tuple (colorbar_limits ),
99107 clabel = colorbar_label ,
100108 width = 1600 , height = 800 , title = title ,
0 commit comments