{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"color_map = dict(\n",
" Asia='#ff798e', \n",
" Europe='#ffeb33', \n",
" Africa='#33dded',\n",
" Americas='#98ef33'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"marker_dict = dict(\n",
" line=dict(\n",
" color='black', \n",
" width=0.8\n",
" ), \n",
" opacity=1\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"layout_dict = dict(\n",
" plot_bgcolor='white', \n",
" yaxis=dict(rangemode='tozero'), \n",
" font=dict(color='dimgray'), \n",
" hoverlabel=dict(font_size=16),\n",
" autosize=False, \n",
" width=800, \n",
" height=600\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"axes_dict = dict(\n",
" showline=True, \n",
" linewidth=1, \n",
" linecolor='dimgray', \n",
" gridcolor='lightgray', \n",
" showspikes=True, \n",
" spikecolor='dimgray', \n",
" spikethickness=1\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"title='Gapminder
Data from gapminder.org, CC-BY license'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def background_year(year):\n",
" \"\"\"Return the dictionary containing a single position for the text that shows the year\"\"\"\n",
" return dict(\n",
" x=[df_info.loc[xaxis, 'Mid']],\n",
" y=[df_info.loc[yaxis, 'Mid']],\n",
" mode=\"text\",\n",
" showlegend=False,\n",
" text=[\"{}\".format(year)],\n",
" textposition=\"middle center\",\n",
" textfont=dict(size=200, color=\"lightgray\")\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}