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

Force basemap to be greyscale #201

Open
matthew-law opened this issue Aug 30, 2022 · 3 comments
Open

Force basemap to be greyscale #201

matthew-law opened this issue Aug 30, 2022 · 3 comments

Comments

@matthew-law
Copy link

It would be useful to be able to turn any basemap greyscale. I've tried passing cmap = 'gray' to cx.add_basemap (which I think calls plt.imshow), but haven't been able to get anything working.

Example of the kind of case in which a greyscale option for the basemap would be handy in the interest of reducing visual clutter / foregrounding the overlying data without losing too much of the information provided by the basemap:
image

@darribas
Copy link
Collaborator

This is a good idea! I guess now you should be able to get there by manipulating the output ax object but that's suboptimal. Maybe one general way of allowing this is to let the user pass keywords for imshow in a imshow_kwds dict?

We can flesh out ideas here and, if you have bandwidth, I'd very much welcome PRs :-)

@martinfleis
Copy link
Member

Two notes on this.

  1. It is often suboptimal and we should prefer using real B&W tiles than forcing grayscale on otherwise coloured image.
  2. We may not be allowed to do it for some tiles. I'd assume that their T&C will prohibit tampering with the image itself.

@martinfleis
Copy link
Member

If someone wanted to do that anyway, here's a nice documentation https://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_rgb_to_gray.html (but ensure that we reimplement it on top of our numpy array and do not depend on scikit-image).

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

No branches or pull requests

3 participants