画图工具包plotly使用
(1)越来越流行 plotly
(2)替换matplotlib
df = px.data.gapminder() df_2007 = df.query("year==2007") fig = px.scatter(df_2007, x="gdpPercap", y="lifeExp", color="continent", size="pop", size_max=50, hover_name="country", animation_frame="year", animation_group="country", log_x="True", labels=dict(pop="Population", dgpPercap="GDP per Capital", lifeExp="Life Expection"), range_x=[100, 100000], range_y=[25,90]) HTML(fig.to_html())
结果:
时刻记着自己要成为什么样的人!