vcinema/map_test.py
2022-06-27 00:11:06 +01:00

14 lines
392 B
Python

import plotly.express as px
import pycountry
df = px.data.gapminder().query("year==2007")
print(df.head())
fig = px.choropleth(df, locations="iso_alpha",
color="lifeExp", # lifeExp is a column of gapminder
hover_name="country", # column to add to hover information
color_continuous_scale=px.colors.sequential.Plasma)
fig.show()