From 430049fb69b019dcb78fd8e0a86e80ec2b7e913d Mon Sep 17 00:00:00 2001 From: sbourdin Date: Thu, 28 Jan 2021 09:32:37 +0100 Subject: [PATCH] Add diverging norm example in plots --- dynamicopy/cartoplot.py | 4 +++- dynamicopy/plot.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dynamicopy/cartoplot.py b/dynamicopy/cartoplot.py index 51b2aaf..c4f9179 100644 --- a/dynamicopy/cartoplot.py +++ b/dynamicopy/cartoplot.py @@ -42,7 +42,9 @@ def lon_lat_plot_map(lon, lat, var, lon_axis=-1, lat_axis=-2, fig_ax=None, title colorbar_label : str, optional label to be shown beside the colorbar, by default '' norm : matplotlib.colors.Norm, optional - normalization of the colormap, by default TwoSlopeNorm(vcenter=0) + normalization for the colormap, by default None + Example : with `import matplotlib.colors as c` in header of your script + * For centering diverging colormap : c.DivergingNorm(vcenter = 0.0) smooth : bool, optional if True, contourf is used instead of pcolormesh, by default False projection : cartopy.crs projection, optional diff --git a/dynamicopy/plot.py b/dynamicopy/plot.py index 71e126b..85b179c 100644 --- a/dynamicopy/plot.py +++ b/dynamicopy/plot.py @@ -61,6 +61,8 @@ def lon_lat_plot(lon, lat, var, lon_axis=-1, lat_axis=-2, fig_ax=None, title='', label of the colorbar, by default '' norm : matplotlib.colors.Norm, optional normalization for the colormap, by default None + Example : with `import matplotlib.colors as c` in header of your script + * For centering diverging colormap : c.DivergingNorm(vcenter = 0.0) smooth : bool, optional if True, contourf is used instead of pcolormesh, by default False savefig : bool, optional @@ -123,6 +125,8 @@ def zonal_plot(lat, lev, var, lat_axis = -1, lev_axis = -2, fig_ax=None, title=' label of the colorbar, by default '' norm : matplotlib.colors.Norm, optional normalization for the colormap, by default None + Example : with `import matplotlib.colors as c` in header of your script + * For centering diverging colormap : c.DivergingNorm(vcenter = 0.0) smooth : bool, optional if True, contourf is used instead of pcolormesh, by default False savefig : bool, optional