From c5a8d5004f75520a54560342684e6a656413d5d4 Mon Sep 17 00:00:00 2001 From: Christian Langevin Date: Mon, 9 Sep 2019 08:04:28 -0500 Subject: [PATCH] fix(gridintersect): removed matplotlib dependency --- flopy/utils/gridintersect.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index 75c65205fc..6162798a53 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -1,4 +1,3 @@ -import matplotlib.pyplot as plt import numpy as np from .geometry import transform try: @@ -1055,6 +1054,10 @@ def plot_polygon(rec, ax=None, **kwargs): returns the axes handle """ + try: + import matplotlib.pyplot as plt + except ImportError: + print('This feature requires matplotlib.') try: from descartes import PolygonPatch except ModuleNotFoundError: @@ -1093,6 +1096,10 @@ def plot_linestring(rec, ax=None, **kwargs): returns the axes handle """ + try: + import matplotlib.pyplot as plt + except ImportError: + print('This feature requires matplotlib.') if ax is None: _, ax = plt.subplots() @@ -1130,6 +1137,10 @@ def plot_point(rec, ax=None, **kwargs): returns the axes handle """ + try: + import matplotlib.pyplot as plt + except ImportError: + print('This feature requires matplotlib.') if ax is None: _, ax = plt.subplots()