Skip to content

Commit

Permalink
Matplotlib 3.8+ compatibility - positional to keyword args and contou…
Browse files Browse the repository at this point in the history
…r 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
  • Loading branch information
kafitzgerald committed Jan 3, 2024
1 parent 1710a65 commit 547b8d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Gallery/Polygons/NCL_polyg_19.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion Gallery/Polygons/NCL_polyg_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 547b8d8

Please sign in to comment.