Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Aug 9, 2017
1 parent c403a2b commit 4981783
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ndlib/test/test_mpl_viz.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import absolute_import

import unittest
import os

import networkx as nx
from ndlib.viz.mpl.DiffusionPrevalence import DiffusionPrevalence
Expand All @@ -12,8 +11,8 @@
import ndlib.models.epidemics.SIRModel as sir
import ndlib.models.epidemics.SIModel as si
from ndlib.viz.mpl.DiffusionTrend import DiffusionTrend
import matplotlib
matplotlib.use('Agg')

import os


class VizTest(unittest.TestCase):
Expand Down
5 changes: 5 additions & 0 deletions ndlib/viz/mpl/ComparisonViz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import abc
from bokeh.palettes import Category20_9 as cols
import os
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
import future.utils
import past
Expand Down
5 changes: 5 additions & 0 deletions ndlib/viz/mpl/DiffusionViz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import abc
from bokeh.palettes import Category20_9 as cols
import os
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
import future.utils

Expand Down

0 comments on commit 4981783

Please sign in to comment.