Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plea for a stock_img() alpha #2179

Closed
CommonClimate opened this issue May 26, 2023 · 2 comments · Fixed by #2230
Closed

Plea for a stock_img() alpha #2179

CommonClimate opened this issue May 26, 2023 · 2 comments · Fixed by #2230
Milestone

Comments

@CommonClimate
Copy link

Description

I am delighted that .add_feature() now allows for transparency via an alpha parameter; this goes a long way to decluttering busy maps. Unfortunately, the same feature is not available for stock_img(), and I was wondering why. I am admittedly ignorant of the way the background is implemented in Cartopy, but given that a lot of matplotlib objects have an alpha parameter, I was hoping this would be a matter of exposing it at the API level. Is this thinking too simplistic?

Proposal

ax.stock_img(alpha=0.5) reduces background opacity by 50%, for instance.

@rcomer
Copy link
Member

rcomer commented May 26, 2023

stock_img passes the image to imshow, and imshow handles alpha. So it looks to me that it might indeed just be a case of exposing the keyword, though I am certainly no expert here.

return self.imshow(imread(fname), origin='upper',
transform=source_proj,
extent=[-180, 180, -90, 90])

@dopplershift
Copy link
Contributor

@rcomer That looks correct to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants