Closed dongrixinyu closed 1 year ago
We just released a new feature that maybe helps with this. It's the use_jenks=True
argument on Choropleth
, for an example and motivation see https://nbviewer.org/github/python-visualization/folium/blob/main/examples/Choropleth%20with%20Jenks%20natural%20breaks%20optimization.ipynb. Note that you will have to install the jenkspy
package for this.
If you're talking about a log scale legend, that's not currently available. Though here's a guide with a work around: https://github.com/python-visualization/folium/issues/1374#issuecomment-1215240840. It may be interesting to have non-linear scaling as a core feature, but it's not something I'm planning on working, so it's dependent on somebody coming along and making a reasonable implementation.
Leafmap has some choropleth map functionality that builds upon folium and mapclassify. Here is an example: https://leafmap.org/notebooks/53_choropleth/
Describe the bug A clear and concise description of what the bug is. Here is an example of how I use choropleth.Map to rendering all provinces and cities population data of china.
and the population of each city ranges from 2300 ~12042384. the number of people for most cities ranges from 2300 ~ 1000000. So the distribution of population for all cities is uneven.
this caused the legend of the population is like above. most part of the legend is dark purple.
So, I recommend that a
log(x)
function is nessesary for the legend to smoothing the data distribution.To Reproduce
Expected behavior A smoothing legend that could tell the number scope of every color.
Environment (please complete the following information):
Additional context Add any other context about the problem here.
Possible solutions List any solutions you may have come up with.
folium is maintained by volunteers. Can you help making a fix for this issue?