Skip to content

Commit

Permalink
close cartopy#1782, change LineString facecolor to None
Browse files Browse the repository at this point in the history
  • Loading branch information
smartlixx committed May 17, 2021
1 parent 115b1ca commit 2cce13d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,20 @@ def add_geometries(self, geoms, crs, **kwargs):
"""
styler = kwargs.pop('styler', None)
has_LineString = False
try:
for g in iter(tuple(geoms)):
if isinstance(g, sgeom.LineString):
has_LineString = True
break
except TypeError:
if isinstance(geoms, sgeom.LineString):
has_LineString = True

if has_LineString:
kwargs['facecolor'] = 'none'
if 'edgecolor' not in kwargs or kwargs['edgecolor'] == 'face':
kwargs['edgecolor'] = mpl.rcParams['patch.edgecolor']
feature = cartopy.feature.ShapelyFeature(geoms, crs, **kwargs)
return self.add_feature(feature, styler=styler)

Expand Down

0 comments on commit 2cce13d

Please sign in to comment.