-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: web friendly improvements to goals map for US states
feat: demo note book added
- Loading branch information
1 parent
4d7c6c9
commit d3466a5
Showing
2 changed files
with
241 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## US State RPS Goals Map with hover-over tool tips\n", | ||
"author: vhunt\n", | ||
"\n", | ||
"updated with breakthrough energy compatible colors 9/23/2020" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%load_ext autoreload\n", | ||
"%autoreload 2" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from bokeh.io import show\n", | ||
"from postreise.plot import plot_carbon_map \n", | ||
"import pandas as pd" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#prepare data for mapping \n", | ||
"\n", | ||
"rps_states = ('AL', 'AR', 'AZ', 'CA', 'CO',\n", | ||
" 'CT', 'DE', 'FL','GA', 'IA', \n", | ||
" 'ID', 'IL', 'IN', 'KS', 'KY',\n", | ||
" 'LA', 'MA', 'MD', 'ME', 'MI',\n", | ||
" 'MN', 'MO', 'MS', 'MT', 'NC', \n", | ||
"\n", | ||
" 'ND', 'NE', 'NH','NJ','NM',\n", | ||
" 'NV','NY', 'OH', 'OK','OR',\n", | ||
" 'PA','RI','SC', 'SD','TN', \n", | ||
" 'TX','UT', 'VA','VT', 'WA',\n", | ||
" 'WI', 'WV','WY',)\n", | ||
"\n", | ||
"color_list = ('#EBEEF1','#EBEEF1','#99CFF6','#0D68DC','#1490FF',\n", | ||
" '#107CED','#1490FF','#EBEEF1','#EBEEF1', '#EBEEF1',\n", | ||
" '#EBEEF1','#1490FF','#99CFF6','#47AFFB','#EBEEF1',\n", | ||
" '#EBEEF1','#107CED','#107CED','#0A55CC','#107CED',\n", | ||
" '#1490FF','#99CFF6', '#EBEEF1', '#99CFF6', '#99CFF6',\n", | ||
" \n", | ||
" '#99CFF6','#EBEEF1','#1490FF','#107CED','#107CED',\n", | ||
" '#107CED', '#0D68DC','#99CFF6','#99CFF6','#1490FF',\n", | ||
" '#47AFFB','#107CED','#99CFF6','#99CFF6','#EBEEF1',\n", | ||
" '#107CED','#47AFFB','#99CFF6','#0A55CC','#0A55CC',\n", | ||
" '#99CFF6','#EBEEF1','#EBEEF1',\n", | ||
" )\n", | ||
"\n", | ||
"label_list = ('no clean energy goals', 'no clean energy goals', '15% in 2025', \n", | ||
" '60% in 2030, 100% in 2045', '30% in 2020, 100% in 2050',\n", | ||
" '44% in 2025','25% in 2025','no clean energy goals', 'no clean energy goals', 'no clean energy goals',\n", | ||
" 'no clean energy goals', '25% in 2025','10% in 2015','20% in 2020','no clean energy goals',\n", | ||
" 'no clean energy goals', ' 35% in 2030','30% in 2020 and 50% in 2030', \n", | ||
" '80% in 2030, 100% in 2050','15% in 2020 and 35% in 2025',\n", | ||
" '25% in 2025','15% in 2020', 'no clean energy goals', '15% in 2020','12.5% in 2020',\n", | ||
" \n", | ||
" '10% in 2020','no clean energy goals','25% in 2025','50% in 2030',\n", | ||
" '40% in 2025, 80% in 2040, 100% in 2045',\n", | ||
" '50% in 2030, 100% in 2050', '70% in 2030, 100% in 2040', '8.5% in 2025', \n", | ||
" '15% in 2020','25% in 2025, 50% in 2040',\n", | ||
" '18% in 2020',\n", | ||
" '16% in 2020, 23.5% in 2025, 31% in 2030, 38.5% in 2035',\n", | ||
" '2% in 2020','10% in 2020', 'no clean energy goals',\n", | ||
" 'no clean energy goals, projected to have 50% in 2030', '20% in 2035', \n", | ||
" '15% in 2025','55% in 2020, 75% in 2030', '80% in 2030, 100% in 2045',\n", | ||
" '10% in 2020', 'no clean energy goals', 'no clean energy goals',\n", | ||
" )\n", | ||
"\n", | ||
"data = {'State': rps_states,\n", | ||
" 'Color': color_list,\n", | ||
" 'Label': label_list,\n", | ||
" }\n", | ||
"\n", | ||
"df = pd.DataFrame (data, columns = ['State','Color','Label'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#prepare data for legend\n", | ||
"\n", | ||
"legend_col = ['#EBEEF1',\n", | ||
" '#99CFF6', \n", | ||
" '#47AFFB',\n", | ||
" '#1490FF',\n", | ||
" '#107CED',\n", | ||
" '#0D68DC',\n", | ||
" '#0A55CC',\n", | ||
" ]\n", | ||
"legend_lab = ['no goals',\n", | ||
" '0-15%', \n", | ||
" '15-20%',\n", | ||
" '20-30%',\n", | ||
" '30-50%',\n", | ||
" '50-70%',\n", | ||
" '70-100%',\n", | ||
" ]\n", | ||
"\n", | ||
"data_leg = {'Color': legend_col,\n", | ||
" 'Label': legend_lab,}\n", | ||
"\n", | ||
"df_leg = pd.DataFrame (data_leg, columns = ['Color','Label'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"goals_demo = plot_carbon_map.plot_states(state_list = df.State, \n", | ||
" col_list = df.Color,\n", | ||
" labels_list = df.Label,\n", | ||
" leg_color = df_leg.Color,\n", | ||
" leg_label = df_leg.Label,\n", | ||
" font_size = '10pt',\n", | ||
" web = True)\n", | ||
"show(goals_demo)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters