Choropleth map not displaying colors
See original GitHub issueI am trying to make a choropleth map using data stored in a ‘.csv’ over a '.geojson’ polygon map. The geojson map is apparently rendering properly, but the colors from the values in the data.csv aren’t showing up at all. I am new using folium and after reading the whole documentation I can’t still figure out what I am doing wrong! I have posted the jupyter notebook and all data in a github repository.
I am working in a conda environment using folium ‘0.5.0’
Thanks in advance!
https://github.com/transluciddata/folium_problem
https://nbviewer.jupyter.org/github/transluciddata/folium_problem/blob/master/prueba.ipynb
import pandas as pd
import folium
import json
import os
regiones_data = os.path.join('regiones.csv')
regiones_geo = os.path.join('regiones.geojson')
data = pd.read_csv(regiones_data, na_values=[' '])
data.info()
m = folium.Map(
location=[-37.807973, -71.894346],
tiles='Mapbox Bright',
zoom_start=4,
control_scale=True
)
m.choropleth(
geo_data=regiones_geo,
name='choropleth',
data=data,
columns=['region_id', 'votos_tricel'],
key_on='feature.properties.region_id',
fill_color='BuPu',
fill_opacity=.7,
line_opacity=.5,
highlight=True,
legend_name='Numero Total de Votos',
reset=True
)
folium.LayerControl().add_to(m)
m
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Choropleth map is not showing color variation in the output
Choropleth map is not showing color variation in the output ; from pandas import ; import os import ; False) vis = os.path.join('Community_Areas....
Read more >Filled map (choropleth) data colors not working
Solved: I'm working on trying to create shading (color scale) on a Filled Map. Following the instructions on.
Read more >Colors not displaying on Plotly Choropleth Map in iPython ...
Hello I recently downloaded and installed plotly in order to create a Choropleth U.S. map of Zika cases in the iPython notebook.
Read more >Choropleth map not displaying color-Pandas,Python
[Solved]-Data visualization: Choropleth map not displaying color-Pandas,Python ... We need to link the country abbreviation name to GeoJson's ISO_A3. from urllib.
Read more >Design Choropleth Colors & Intervals
Good choropleth maps make true and insightful geographic patterns clearly visible to readers, whether they are printed in black-and-white on paper or displayed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is with the region_ids in your geojson. Their values are strings, but in the csv they are ints. If you change the values in the geojson to ints it works:
"region_id": "2"
becomes
"region_id": 2
you’re not adding the choropleth to the map
On Sun, Jul 22, 2018, 12:09 Mauricio Cifuentes Navarro < notifications@github.com> wrote: