画图工具包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())

结果:

 

posted @   今夜无风  阅读(48)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2019-09-20 文本分类研究最新调研
2019-09-20 自动问答最新研究成果展示(SQuAD)
点击右上角即可分享
微信分享提示