Skip to content

Commit

Permalink
Merge pull request #2230 from smartlixx/alpha_stock_img
Browse files Browse the repository at this point in the history
Pass options of stock_img to imshow
  • Loading branch information
greglucas authored Aug 22, 2023
2 parents ab07031 + c16a9ad commit dde6325
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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)

Expand Down

0 comments on commit dde6325

Please sign in to comment.