-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add support for legend_field with geo data #9398
Comments
@raholler It would be a fair amount of effort to make However, a very minor change allows I am going to mark this issue as a feature to add support for Would you like to work on this PR, with some guidance? |
For refernece, the change I made to generate the above plot with
A real solution would not comment out the validation check, but either:
|
I generally would work on it with some guidance, but I am overly busy until December 13th. If after that is fine for you, I can do it (try, am not that experienced in working on packages). But I think in general, one could rethink the treatment of geodata. Most people that work with geodata in python use geopandas. Maybe a more direct link to geopandas would be useful/easier instead of going through GeoJSON. I saw a related issue, but cannot find it anymore. |
@raholler There's not hurry so happy to work with you on this whenever you are able to look at it. As for GeoPandas, I think that would be fantastic, but is also an orthogonal concern, I think. It would be appropriate to make a new issue to start a discussion about that. |
I came across this while looking for a way to add a legend to a heatmap with a linear colormapper that uses a GeoJSONDataSource. But the The figure is basically this:
|
I ran into the same issue with the custom legend for geopandas. This is working somewhat for me. It will work if you don't expect x_range or y_range to change. Trying to figure out how to prevent the "fake quads" from rendering, so it will not affect x_range or y_range when replacing the content of a figure. It will be nice that manual legends can be implemented without having to specify an actual coordinate pair in the plot.
|
ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)
Description of expected behavior and the observed behavior
I want to add a legend to my plot of Geodata. In particular, I plot point data with different coloring according to a categorical variable in my data set. I transform my geopandas to to a GeoJsonDataSource accordingly. Everything works well, except creating the legend.
When I follow the following example: https://docs.bokeh.org/en/latest/docs/user_guide/annotations.html#legends
I get the following error:
Even though I include the source in the glyph method, i.e.
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
The text was updated successfully, but these errors were encountered: