From b9f57341c4ba85389c46fe382562ce49922acf18 Mon Sep 17 00:00:00 2001 From: Katelyn FitzGerald <7872563+kafitzgerald@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:08:12 -0600 Subject: [PATCH] Update NCL_overlay_11b.py to address matplotlib 3.10 changes --- Gallery/Overlays/NCL_overlay_11b.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Gallery/Overlays/NCL_overlay_11b.py b/Gallery/Overlays/NCL_overlay_11b.py index a9848737d..6c0fef6b1 100644 --- a/Gallery/Overlays/NCL_overlay_11b.py +++ b/Gallery/Overlays/NCL_overlay_11b.py @@ -175,15 +175,7 @@ # another contour plot and clip that contour plot with the patch. In # other words, every island on this plot corresponds to its own # contour plot!) - cf = ax.contourf(lon, lat, T, levels=clevs, cmap=newcmp) - - # Clip each contour of the contour plot - # (NOTE: Each contour of the contour plot is actually its own "plot". There - # is no easy mechanism in matplotlib to clip the entire contour plot - # at once, so we must loop through the "collections" in the contour - # plot and clip each one separately.) - for col in cf.collections: - col.set_clip_path(patch) + cf = ax.contourf(lon, lat, T, levels=clevs, cmap=newcmp, clip_path=patch) # Add horizontal colorbar cax = plt.axes((0.14, 0.08, 0.74, 0.02))