Skip to content

Commit e8293b3

Browse files
committed
fix(plot): don't require Matplotlib if no Window asked
1 parent dc5a21a commit e8293b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graphkit/network.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ def plot_graph(graph, filename=None, show=False, steps=None,
524524
525525
"""
526526
import pydot
527-
import matplotlib.pyplot as plt
528-
import matplotlib.image as mpimg
529527

530528
assert graph is not None
531529

@@ -610,6 +608,9 @@ def get_node_name(a):
610608

611609
# display graph via matplotlib
612610
if show:
611+
import matplotlib.pyplot as plt
612+
import matplotlib.image as mpimg
613+
613614
png = g.create_png()
614615
sio = io.BytesIO(png)
615616
img = mpimg.imread(sio)

0 commit comments

Comments
 (0)