Skip to content

Commit

Permalink
move import of matplotlib to inside function
Browse files Browse the repository at this point in the history
  • Loading branch information
erelsgl committed Aug 6, 2024
1 parent c8cace0 commit 8ab879a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import networkx as nx
import networkx.algorithms.connectivity as algo
import matplotlib.pyplot as plt
import numpy as np
from enum import Enum
import copy
Expand Down Expand Up @@ -835,6 +834,7 @@ def display_graph(graph:nx.DiGraph) -> None:
graph : nx.DiGraph
Directed graph.
"""
import matplotlib.pyplot as plt
pos = nx.shell_layout(graph)
colors = [node_colors.get(data.get('status', 'default'), 'default') for node, data in graph.nodes(data=True)]
nx.draw(graph, pos, node_color=colors, with_labels=True, font_weight='bold')
Expand Down

0 comments on commit 8ab879a

Please sign in to comment.