We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f58f5ba commit 889252bCopy full SHA for 889252b
firedrake/pyplot/mpl.py
@@ -162,7 +162,12 @@ def facet_data(typ):
162
color_key = "colors" if tdim <= 2 else "facecolors"
163
boundary_colors = boundary_kw.pop(color_key, None)
164
if boundary_colors is None:
165
- cmap = matplotlib.cm.get_cmap("Dark2")
+ # matplotlib.cm.get_cmap was deprecated in Matplotlib 3.9, see:
166
+ # https://matplotlib.org/3.9.0/api/prev_api_changes/api_changes_3.9.0.html#top-level-cmap-registration-and-access-functions-in-mpl-cm
167
+ try:
168
+ cmap = matplotlib.cm.get_cmap("Dark2")
169
+ except AttributeError:
170
+ cmap = matplotlib.colormaps["Dark2"]
171
num_markers = len(markers)
172
colors = cmap([k / num_markers for k in range(num_markers)])
173
else:
0 commit comments