Skip to content

Commit

Permalink
FIX: close the path on GeoSpines around the boundary
Browse files Browse the repository at this point in the history
The GeoSpine class surrounds the entire region and thus should be closed.
Previously, there would be a small gap at the corner of closure due
to the capstyle of the lines being "butt" by default. To avoid any
capstyle issues, we can just set the path to be closed.
  • Loading branch information
greglucas committed Jun 6, 2023
1 parent ff28510 commit 7e740b6
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ def __init__(self, axes, **kwargs):
self._original_path = mpath.Path(np.empty((0, 2)))
kwargs.setdefault('clip_on', False)
super().__init__(axes, 'geo', self._original_path, **kwargs)
self.set_capstyle('butt')

def set_boundary(self, path, transform):
self._original_path = path
Expand All @@ -272,6 +271,7 @@ 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)

def get_window_extent(self, renderer=None):
# make sure the location is updated so that transforms etc are
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/cartopy/tests/mpl/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_web_tiles():

@pytest.mark.natural_earth
@pytest.mark.network
@pytest.mark.mpl_image_compare(filename='image_merge.png', tolerance=0.01)
@pytest.mark.mpl_image_compare(filename='image_merge.png', tolerance=0.03)
def test_image_merge():
# tests the basic image merging functionality
tiles = []
Expand Down

0 comments on commit 7e740b6

Please sign in to comment.