-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now use cb.mappable.set_norm to set color bar range
This commit addresses GCPy issue #24: #24 which says that the set_clim function will be deprecated in a future version of matplotlib. The matplotlib documentation about API changes https://matplotlib.org/3.1.0/api/api_changes.html says this: "matplotlib.colorbar.ColorbarBase is no longer a subclass of cm.ScalarMappable. This inheritance lead to a confusing situation where the cm.ScalarMappable passed to matplotlib.colorbar.Colorbar (colorbar) had a set_norm method, as did the colorbar. The colorbar is now purely a follower to the ScalarMappable norm and colormap, and the old inherited methods set_norm, set_cmap, set_clim are deprecated, as are the getter versions of those calls. To set the norm associated with a colorbar do colorbar.mappable.set_norm() etc." Therefore, we now use cb.mappable.set_norm(norm) to manually pass the norm object (which renders the data range into the range of 0..1 for plotting) to the colorbar. This produces the same effect as before. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
- Loading branch information
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters