Plotly与chart_studio入门到放弃之系列一

本文介绍了Plotly的基础用法,通过实例展示了如何创建互动式图表,并探讨了绘图参数,强调了理解参数对提升图表设计的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Your charts. Your style. Your way.
Create, style and publish interactive web-ready charts
No coding required

在这里插入图片描述
最近买了一本《基于plotly的动态可视化绘图》,发现书还是跟不上官方文档啊!

在书上介绍还有官网介绍的记录plotlyUsernameAPI_key,这里貌似在当前目录很难生成一个.plotly/.credentials,路过的有知道的可以在评论区留言让我明白一下!

发现在官网找到了这一句:Online features (plotly.plotly) moved to chart-studio package

给上官网最近新近版本的介绍:Version 4 Migration Guide in Python

  • Replace plotly.api with chart_studio.api
  • Replace plotly.dashboard_objs with chart_studio.dashboard_objs
  • Replace plotly.grid_objs with chart_studio.grid_objs
  • Replace plotly.presentation_objs with chart_studio.presentation_objs
  • Replace plotly.widgets with chart_studio.widgets

貌似在官网中找到了一些眉目:online features已经迁移到chart_studio库中,貌似看起来还不错的样子!

import chart_studio
chart_studio.tools.set_credentials_file(
    username='', # 这儿就不放我自己的账号和api了
    api_key=''
    )
import chart_studio.plotly as py
from plotly.graph_objects import Scatter
trace0 = Scatter(
    x = [1, 2, 3, 4],
    y = [10, 15, 13, 17]
)
trace1 = Scatter(
    x = [1, 2, 3, 4],
    y = [16, 5, 11, 9]
)
data = ([trace0, trace1])
py.plot(data, filename='first_start')

在这里插入图片描述
自己从iris数据中玩一下

import plotly as py
import plotly
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值