From c16a9ad2043ece1df0a900df3013a866e6845bd4 Mon Sep 17 00:00:00 2001 From: Xianxiang Li Date: Sun, 6 Aug 2023 15:07:22 +0800 Subject: [PATCH] Pass options of stock_img to imshow --- lib/cartopy/mpl/geoaxes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index 18e38a400..b56eb13be 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -999,12 +999,13 @@ def set_yticks(self, ticks, minor=False, crs=None): return super().set_yticks(yticks, minor=minor) - def stock_img(self, name='ne_shaded'): + def stock_img(self, name='ne_shaded', **kwargs): """ Add a standard image to the map. - Currently, the only (and default) option is a downsampled version of - the Natural Earth shaded relief raster. + Currently, the only (and default) option for image is a downsampled + version of the Natural Earth shaded relief raster. Other options + (e.g., alpha) will be passed to :func:`GeoAxes.imshow`. """ if name == 'ne_shaded': @@ -1014,7 +1015,8 @@ def stock_img(self, name='ne_shaded'): return self.imshow(imread(fname), origin='upper', transform=source_proj, - extent=[-180, 180, -90, 90]) + extent=[-180, 180, -90, 90], + **kwargs) else: raise ValueError('Unknown stock image %r.' % name)