Skip to content

Commit

Permalink
fix usage of multi-paths with GeoSpines
Browse files Browse the repository at this point in the history
In case the GeoSpine path represents a multi-path, don't attemt to close
it since this would convert the multi-path into a single closed path
resulting in unwanted connector-lines between the individual polygons.
  • Loading branch information
raphaelquast committed Mar 28, 2024
1 parent 75ec0fa commit 7bca0a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ def set_boundary(self, path, transform):
def _adjust_location(self):
if self.stale:
self._path = self._original_path.clip_to_bbox(self.axes.viewLim)
self._path = mpath.Path(self._path.vertices, closed=True)
# Only close paths that represent a single closed polygon.
if np.count_nonzero(self._path.codes == mpath.Path.MOVETO) <= 1:
self._path = mpath.Path(self._path.vertices, closed=True)

def get_window_extent(self, renderer=None):
# make sure the location is updated so that transforms etc are
Expand Down

0 comments on commit 7bca0a3

Please sign in to comment.