Skip to content

Commit

Permalink
Checking for MATPLOTLIB installation
Browse files Browse the repository at this point in the history
  • Loading branch information
tkralphs committed Apr 13, 2020
1 parent 6422554 commit ddd2054
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/grumpy/polyhedron2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
from pypolyhedron.polyhedron import Vrep, Hrep
from math import ceil, floor

import matplotlib.pyplot as plt
import matplotlib.lines as lines
try:
import matplotlib.pyplot as plt
import matplotlib.lines as lines
MATPLOTLIB_INSTALLED = True
except:
MATPLOTLIB_INSTALLED = False

closed = False

Expand Down Expand Up @@ -133,6 +137,8 @@ class Figure(object):
def __init__(self):
self.fig = None
self.ax = None
if MATPLOTLIB_INSTALLED == False:
raise Exception('Matplotlib not installed, figures cannot be created')

def initialize(self):
if self.fig == None:
Expand Down

0 comments on commit ddd2054

Please sign in to comment.