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

Display colorbar #14

Closed
davidbrochart opened this issue Jun 27, 2020 · 5 comments
Closed

Display colorbar #14

davidbrochart opened this issue Jun 27, 2020 · 5 comments

Comments

@davidbrochart
Copy link
Collaborator

We need a way to display a colorbar. The colormap currently uses matplotlib, so the easiest way is to show the colorbar with matplotlib and show it outside the map. It should also be possible to show it inside the map.
Another way would be to use a custom legend control in Leaflet, but we need a way to match matplotlib's colormap. Or use Leaflet's colormap instead of matplotlib's.

@giswqs
Copy link

giswqs commented Jul 1, 2020

In geemap, I generate the legend (with discrete values) using HTML, and then add a HTML widget in ipyleaflet to display it. Not quite sure about continuous colormap.

@davidbrochart
Copy link
Collaborator Author

Interesting. We could also use branca as in https://github.com/jupyter-widgets/ipyleaflet/blob/master/examples/Choropleth.ipynb.

@giswqs
Copy link

giswqs commented Jul 1, 2020

The branca colormap can be printed out in a notebook cell. So the problem would be to customize it (size, orientation, etc) and add it into the map?

@davidbrochart
Copy link
Collaborator Author

That could be, yes. We also need to have an equivalent matplotlib colormap in Python when we apply the colormap. I don't know if we can use branca for that too.

@davidbrochart
Copy link
Collaborator Author

Done in #33.

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

2 participants