From 77bb8528793f7044cfb5376334020919c5e458df Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Mon, 29 Jun 2026 16:49:34 -0400 Subject: [PATCH] matplotlib 3.9 API change Signed-off-by: Steven Hahn --- wfcommons/wfchef/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wfcommons/wfchef/utils.py b/wfcommons/wfchef/utils.py index f96379f7..066f812a 100644 --- a/wfcommons/wfchef/utils.py +++ b/wfcommons/wfchef/utils.py @@ -11,12 +11,12 @@ import json import pathlib +import matplotlib as mpl import matplotlib.patches as mpatches import matplotlib.pyplot as plt import networkx as nx from hashlib import sha256 -from matplotlib import cm from typing import Iterable, Union, Set, Optional, Tuple, Hashable this_dir = pathlib.Path(__file__).resolve().parent @@ -213,7 +213,7 @@ def draw(g: nx.DiGraph, node_border_colors.get(src) if node_border_colors.get(src, -1) == node_border_colors.get(dst, 1) else "black" for src, dst in g.edges ] - cmap = cm.get_cmap('rainbow', len(type_set)) + cmap = mpl.colormaps['rainbow'].resampled(len(type_set)) nx.draw(g, pos, node_size=node_size, node_color=node_color, edgecolors=edgecolors, edge_color=edge_color, linewidths=linewidths, cmap=cmap, ax=ax, with_labels=with_labels) color_lines = [mpatches.Patch(color=cmap(types[t]), label=t) for t in type_set]