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

Feature: mpl palettes and bokeh palettes do not work with geoplot #109

Open
sufyankazi opened this issue Jul 6, 2021 · 1 comment
Open

Comments

@sufyankazi
Copy link

I'm trying to plot with a custom colorbar and colormap, but I'm unable to do it. I haven't found a way to add it in.

#matplotlib mapper -> does not work
mapper = CategoricalColorMapper(palette=['#66ff00', '#32cd32', 'yellow', 'red'], 
                                factors=['A', 'B', 'C', 'D'])
#bokeh mapper -> does not work
color_mapper = LinearColorMapper(palette='Magma256', 
                                 low=2000000, 
                                 low_color='red', 
                                 high=500000,
                                 high_color='#66ff00')

p = plot_df.plot_bokeh(simplify_shapes=10000, 
                     category="target1", 
                     colormap=mapper
                       colorbar_tick_format="0.0a",
                     hovertool_columns=["target1"],
                     figsize=(900,600))

I am trying to make a custom colorbar with where values are transformed to a custom mapper like this:

0-199 -> red,
200-299 -> 'orange'
300-599 -> 'yellow'
600+ -> 'green'

see here for more details
https://stackoverflow.com/questions/68275944/how-to-make-a-custom-colorbar-and-fill-color-with-geopandas-and-bokeh?

@PatrikHlobil
Copy link
Owner

Hi @sufyankazi,

this is currently not supported by pandas-bokeh. you can only use the buildin colormaps or list of colors. could you give a minimal code example in which such a feature would be nice to have?

Best Patrik

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