|
14 | 14 | # Let Folium determine the scale.
|
15 | 15 | states = folium.Map(location=[48, -102], zoom_start=3)
|
16 | 16 | states.choropleth(geo_path=state_geo, data=state_data,
|
17 |
| - columns=['State', 'Unemployment'], |
18 |
| - key_on='feature.id', |
19 |
| - fill_color='YlGn', fill_opacity=0.7, line_opacity=0.2, |
20 |
| - legend_name='Unemployment Rate (%)') |
| 17 | + columns=['State', 'Unemployment'], |
| 18 | + key_on='feature.id', |
| 19 | + fill_color='YlGn', fill_opacity=0.7, line_opacity=0.2, |
| 20 | + legend_name='Unemployment Rate (%)') |
21 | 21 | states.save(outfile='us_state_map.html')
|
22 | 22 |
|
23 | 23 | # Let's define our own scale and change the line opacity.
|
24 | 24 | states2 = folium.Map(location=[48, -102], zoom_start=3)
|
25 | 25 | states2.choropleth(geo_path=state_geo, data=state_data,
|
26 |
| - columns=['State', 'Unemployment'], |
27 |
| - threshold_scale=[5, 6, 7, 8, 9, 10], |
28 |
| - key_on='feature.id', |
29 |
| - fill_color='BuPu', fill_opacity=0.7, line_opacity=0.5, |
30 |
| - legend_name='Unemployment Rate (%)', |
31 |
| - reset=True) |
| 26 | + columns=['State', 'Unemployment'], |
| 27 | + threshold_scale=[5, 6, 7, 8, 9, 10], |
| 28 | + key_on='feature.id', |
| 29 | + fill_color='BuPu', fill_opacity=0.7, line_opacity=0.5, |
| 30 | + legend_name='Unemployment Rate (%)', |
| 31 | + reset=True) |
32 | 32 | states2.save(outfile='us_state_map_2.html')
|
0 commit comments