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

Colormap banding #89

Closed
Chrismarsh opened this issue Apr 1, 2021 · 1 comment
Closed

Colormap banding #89

Chrismarsh opened this issue Apr 1, 2021 · 1 comment

Comments

@Chrismarsh
Copy link

When attaching a LinearColormap to a folium.raster_layers.TileLayer map, I'm getting banding in the fill

image
This appears to persist across various OS and browser combinations

I'm creating the colour map as

import branca.colormap as cm
import seaborn as sns

#[...]

cmap = sns.color_palette("YlGnBu", 12)
colormap = cm.LinearColormap(colors=cmap, vmin=vmin, vmax=vmax)
m.add_child(colormap)

#[...]

I've isolated the problem with the rect width being set here
https://github.com/python-visualization/branca/blob/master/branca/templates/color_scale.js#L48

For my case, this function is returning a width of ~0.8 (although each rect is slightly different widths).

If I set width=1.5 the problem is resolved
image

I'm wondering if this is intended behaviour, if it's a bug, and/or if there are any unintended consequences to changing the width.

@Conengmo
Copy link
Member

Conengmo commented Nov 5, 2022

I'm not sure how this code came about and I would have to guess what is causing the banding.

For me, I don't see banding with the current code. Setting a particular width doesn't change that. If I zoom the page in I do get banding at some zoom levels, but not all.

I'm going to say this is not something we have to strive to resolve. But if somebody can provide more insight on this that is welcome!

@Conengmo Conengmo closed this as completed Nov 5, 2022
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