Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion flopy/utils/gridintersect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import matplotlib.pyplot as plt
import numpy as np
from .geometry import transform
try:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down