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 f63b366
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,15 @@ def add_geometries(self, geoms, crs, **kwargs):
"""
styler = kwargs.pop('styler', None)
has_LineString = False
for g in iter(tuple(geoms)):
if isinstance(g, sgeom.LineString):
has_LineString = True
break
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 f63b366

Please sign in to comment.