Skip to content

Commit

Permalink
Remaining changes to support Matplotlib 3.10 (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
kafitzgerald authored Dec 13, 2024
1 parent 4369318 commit 08cb17b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
5 changes: 2 additions & 3 deletions Gallery/Contours/NCL_coneff_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@
cmap='white') # Use white cmap to have a white background

# Set the colors for the hatches
for i, collection in enumerate(p.collections):
collection.set_edgecolor(colors[i % len(colors)])
collection.set_linewidth(0.)
p.set_edgecolors(colors)
p.set_linewidth(0.)

# Set linewidth of hatches
plt.rcParams['hatch.linewidth'] = 2.5
Expand Down
9 changes: 1 addition & 8 deletions Gallery/Contours/NCL_hov_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,7 @@
levels=np.arange(-6, 12, 2),
colors='black',
linestyles="-",
linewidths=.2)

# Set 0 level contour line to a thicker linewidth
# If you try to access the "levels" attribute of cs (cs.levels),
# the list of levels is: [-6, -4, -2, 0, 2, 4, 6, 8, 10]
# level 0 is at the 3rd index of that list, so those contour lines
# can be accessed at cs.collections[3]
cs.collections[3].set_linewidth(1)
linewidths=[.2, .2, .2, 1, .2, .2, .2, .2, .2])

# Label the contour levels -4, 0, and 4
cl = ax.clabel(cs, fmt='%d', levels=[-4, 0, 4])
Expand Down

0 comments on commit 08cb17b

Please sign in to comment.