Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address CI failures from upstream Matplotlib changes #621

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Gallery/Contours/NCL_hov_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
hatches=['....'])

# Make all dot-filled areas light gray so contour lines are still visible
for i, collection in enumerate(cf.collections):
collection.set_edgecolor('lightgray')
collection.set_linewidth(0.)
cf.set_edgecolor('lightgray')
cf.set_linewidth(0.)

# Fill area at the lowest contour level, -6, with line hatching
cf = ax.contourf(lon,
Expand Down
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
13 changes: 6 additions & 7 deletions Gallery/XY/NCL_xy_16.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@

# Add legend
handles, labels = ax.get_legend_handles_labels()
# Default order is the order in which the data was plotted
handles = reversed(handles) # Reverse order of legend elements
labels = reversed(labels)

plt.legend(handles,
labels,
loc='center right',
frameon=False,
fontsize=14,
labelspacing=1)
labelspacing=1,
reverse=True)

plt.show()

Expand Down Expand Up @@ -183,13 +182,13 @@
# Add legend
handles, labels = ax.get_legend_handles_labels()
# Default order is the order in which the data was plotted
handles = reversed(handles) # Reverse order of legend elements
labels = reversed(labels)

plt.legend(handles,
labels,
loc='center right',
frameon=False,
fontsize=14,
labelspacing=1)
labelspacing=1,
reverse=True)

plt.show()