Skip to content

Commit

Permalink
Update NCL_overlay_11b.py to address matplotlib 3.10 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kafitzgerald authored Oct 16, 2024
1 parent 0f9081e commit b9f5734
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Gallery/Overlays/NCL_overlay_11b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b9f5734

Please sign in to comment.