import pandas as pd
import plotly.express as plot
if __name__ == '__main__':
df=pd.read_csv("./gdp.csv")
fig=plot.scatter(
df,
x="gdpPercap",
y="lifeExp",
animation_frame="year",
size="country_pop",
color="continent",
hover_name="country",
log_x=True,
size_max=80,
range_x=[200,90000],
range_y=[30,90]
)
fig.update_layout(width=900,
height=600,
xaxis_showgrid=False,
yaxis_showgrid=False,
paper_bgcolor='rgba(0,0,0,0)')
fig.show()
暂无评论