Skip to content
Snippets Groups Projects
Commit 0a6ef19c authored by Nils Brüggemann's avatar Nils Brüggemann
Browse files

../pyicon/pyicon_plotting.py: Some small changes to increase compatibility with matplotlib 3.4.2.

parent e8f0b2ed
No related branches found
No related tags found
No related merge requests found
...@@ -492,6 +492,11 @@ def shade( ...@@ -492,6 +492,11 @@ def shade(
norm = matplotlib.colors.BoundaryNorm(boundaries=clevs, ncolors=cmap.N) norm = matplotlib.colors.BoundaryNorm(boundaries=clevs, ncolors=cmap.N)
cmap.set_under(cmap_e(norm_e(0))) cmap.set_under(cmap_e(norm_e(0)))
cmap.set_over(cmap_e(norm_e(nlev))) cmap.set_over(cmap_e(norm_e(nlev)))
vmin = None
vmax = None
else:
vmin = clim[0]
vmax = clim[1]
# --- decide whether to use extra contour lines # --- decide whether to use extra contour lines
if conts is None: if conts is None:
...@@ -553,7 +558,7 @@ def shade( ...@@ -553,7 +558,7 @@ def shade(
norm=norm, norm=norm,
rasterized=rasterized, rasterized=rasterized,
edgecolor=edgecolor, edgecolor=edgecolor,
shading='nearest', shading='auto',
**ccrsdict **ccrsdict
) )
else: else:
...@@ -635,7 +640,7 @@ def shade( ...@@ -635,7 +640,7 @@ def shade(
else: else:
cborientation = 'horizontal' cborientation = 'horizontal'
# ------ make actual colorbar # ------ make actual colorbar
cb = plt.colorbar(mappable=hm, cax=cax, extend=extend, orientation=cborientation) cb = plt.colorbar(mappable=hm, cax=cax, orientation=cborientation)
# ------ prevent white lines if fig is saved as pdf # ------ prevent white lines if fig is saved as pdf
cb.solids.set_edgecolor("face") cb.solids.set_edgecolor("face")
# ------ use exponential notation for large colorbar ticks # ------ use exponential notation for large colorbar ticks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment