创新互联Python教程:python使用Plotly实现动画设计

python使用Plotly实现动画设计

1、呈现动画散点图

绘画散点图的图表是:scatter

import plotly.express as px
df = px.data.gapminder()
px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
           size="pop", color="continent", hover_name="country",
           log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])

输出效果

2、动画条形图

import plotly.express as px

df = px.data.gapminder()

fig = px.bar(df, x="continent", y="pop", color="continent",
  animation_frame="year", animation_group="country", range_y=[0,4000000000])
fig.show()

输出效果


当前标题:创新互联Python教程:python使用Plotly实现动画设计
文章路径:http://bzwzjz.com/article/djjdidp.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 营销型网站建设 企业网站设计 品牌网站建设 网站建设推广 网站设计 成都网站制作 成都网站建设 手机网站制作 重庆网站制作 梓潼网站设计 网站建设改版 外贸网站设计方案 H5网站制作 手机网站建设 LED网站设计方案 四川成都网站建设 定制网站设计 宜宾网站设计 高端定制网站设计 手机网站制作设计 重庆手机网站建设 温江网站设计