From 547b8d84385451f45589984819e97a432c295c37 Mon Sep 17 00:00:00 2001 From: Katelyn FitzGerald <7872563+kafitzgerald@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:10:00 -0700 Subject: [PATCH] Matplotlib 3.8+ compatibility - positional to keyword args and contour label specification fixes (#579) * positional to keyword args in NCL_polyg_19.py * Remove clabel levels that no longer work with mpl 3.8+ in NCL_polyg_4.py * fix formatting --- Gallery/Polygons/NCL_polyg_19.py | 10 ++++++++-- Gallery/Polygons/NCL_polyg_4.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Gallery/Polygons/NCL_polyg_19.py b/Gallery/Polygons/NCL_polyg_19.py index 445818f97..101712efe 100755 --- a/Gallery/Polygons/NCL_polyg_19.py +++ b/Gallery/Polygons/NCL_polyg_19.py @@ -164,13 +164,19 @@ def plotRegion(region, axis, xlim, puertoRico, waterBody): color = findDivColor(colorbounds, pop) # Set characteristics and measurements of each filled polygon "patch" patches.append( - Polygon(np.vstack((x, y)).T, True, color=color, linewidth=0.1)) + Polygon(np.vstack((x, y)).T, + closed=True, + color=color, + linewidth=0.1)) # If the region being plotted is a body of water with no population else: # Set characteristics and measurements of each filled polygon "patch" water_patches.append( - Polygon(np.vstack((x, y)).T, True, color='white', linewidth=.7)) + Polygon(np.vstack((x, y)).T, + closed=True, + color='white', + linewidth=.7)) pc = PatchCollection(patches, match_original=True, diff --git a/Gallery/Polygons/NCL_polyg_4.py b/Gallery/Polygons/NCL_polyg_4.py index ded9bc2c5..a4e101429 100644 --- a/Gallery/Polygons/NCL_polyg_4.py +++ b/Gallery/Polygons/NCL_polyg_4.py @@ -101,7 +101,6 @@ def make_base_plot(): ] ax.clabel( hdl, - np.arange(-8, 24, 8), # Only label these contour levels: [-8, 0, 8, 16] fontsize="small", colors="black", fmt="%.0f", # Turn off decimal points