Skip to content

Commit de57eac

Browse files
committed
Fixes #341: Moved example to renamed file
1 parent 5574b10 commit de57eac

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

examples/GeoJSON_and_choropleth.ipynb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,37 @@
783783
"m"
784784
]
785785
},
786+
{
787+
"cell_type": "markdown",
788+
"metadata": {},
789+
"source": [
790+
"You can also enable the highlight function, to enable highlight functionality when you hover over each area."
791+
]
792+
},
793+
{
794+
"cell_type": "code",
795+
"execution_count": null,
796+
"metadata": {
797+
"collapsed": true
798+
},
799+
"outputs": [],
800+
"source": [
801+
"state_geo = r'us-states.json'\n",
802+
"state_unemployment = r'US_Unemployment_Oct2012.csv'\n",
803+
"\n",
804+
"state_data = pd.read_csv(state_unemployment)\n",
805+
"\n",
806+
"#Let Folium determine the scale\n",
807+
"states = folium.Map(location=[48, -102], zoom_start=3)\n",
808+
"states.choropleth(geo_path=state_geo, data=state_data,\n",
809+
" columns=['State', 'Unemployment'],\n",
810+
" key_on='feature.id',\n",
811+
" fill_color='YlGn', fill_opacity=0.7, line_opacity=0.2,\n",
812+
" legend_name='Unemployment Rate (%)', highlight=True)\n",
813+
"\n",
814+
"states"
815+
]
816+
},
786817
{
787818
"cell_type": "markdown",
788819
"metadata": {},

0 commit comments

Comments
 (0)