Skip to content

Commit

Permalink
Add 'norm' in init_artists in holoviews/plotting/mpl/raster.py (#6029)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGiles committed Dec 12, 2023
1 parent 2913005 commit 5308bb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions holoviews/plotting/mpl/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ def init_artists(self, ax, plot_args, plot_kwargs):
plot_method = self._plot_methods.get('batched' if self.batched else 'single')
plot_fn = getattr(ax, plot_method)
if 'norm' in plot_kwargs: # vmin/vmax should now be exclusively in norm
plot_kwargs.pop('vmin', None)
plot_kwargs.pop('vmax', None)
plot_kwargs.pop('vmin', None)
plot_kwargs.pop('vmax', None)
with warnings.catch_warnings():
# scatter have a default cmap and with an empty array will emit this warning
warnings.filterwarnings('ignore', "No data for colormapping provided via 'c'")
Expand Down
3 changes: 3 additions & 0 deletions holoviews/plotting/mpl/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def init_artists(self, ax, plot_args, plot_kwargs):
locs = plot_kwargs.pop('locs', None)
artist = ax.pcolormesh(*plot_args, **plot_kwargs)
colorbar = self.handles.get('cbar')
if 'norm' in plot_kwargs: # vmin/vmax should now be exclusively in norm
plot_kwargs.pop('vmin', None)
plot_kwargs.pop('vmax', None)
if colorbar and mpl_version < Version('3.1'):
colorbar.set_norm(artist.norm)
if hasattr(colorbar, 'set_array'):
Expand Down

0 comments on commit 5308bb5

Please sign in to comment.