Skip to content

Instantly share code, notes, and snippets.

@cereniyim
Last active January 19, 2020 09:11
Show Gist options
  • Save cereniyim/ad6f47a5787a0ef6d6bff51c9fe6ba95 to your computer and use it in GitHub Desktop.
Save cereniyim/ad6f47a5787a0ef6d6bff51c9fe6ba95 to your computer and use it in GitHub Desktop.
Factfulness Bubble Chart for 2018
fig = px.scatter(gapminder_2018,
x="Income",
y="Life Expectancy",
size="Population",
size_max=60,
color="Region",
hover_name="Country",
facet_col="Income Level",
color_discrete_sequence=["#FF69B4", "#87CEFA",
"#FFFF00", "#32CD32"],
range_y=[50, 90],
width=1000,
labels={"Income": "Income in $s",
"Life Expectancy": "Life Expectancy in years"},
title="World Map for Health and Wealth (data from 2018)",
opacity=1
)
fig.layout.xaxis1.update(matches=None)
fig.layout.xaxis2.update(matches=None)
fig.layout.xaxis3.update(matches=None)
fig.layout.xaxis4.update(matches=None)
py.iplot(fig, sharing='public', filename='factfulness_bubble_chart_2018')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment