Skip to content
Merged
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
4 changes: 2 additions & 2 deletions wfcommons/wfchef/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
Loading