Skip to content

Commit

Permalink
fix(plot): don't require Matplotlib if no Window asked
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis committed Oct 5, 2019
1 parent dc5a21a commit e8293b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions graphkit/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ def plot_graph(graph, filename=None, show=False, steps=None,
"""
import pydot
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

assert graph is not None

Expand Down Expand Up @@ -610,6 +608,9 @@ def get_node_name(a):

# display graph via matplotlib
if show:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

png = g.create_png()
sio = io.BytesIO(png)
img = mpimg.imread(sio)
Expand Down

0 comments on commit e8293b3

Please sign in to comment.