首页 > 编程知识 正文

苹果xs新手使用指南,使用指南

时间:2023-05-05 15:24:59 阅读:172821 作者:1379

plotly是开挂的制图神器,可以在js、python、r、DB等中使用。 具体请参考官方网站plotly官方网站

安装pip安装打印的更新

pip install plotly --upgrade 2.在线使用。 绘制的图将保存在云帐户中的import plotly#配置用户名和API-keyplotly.tools.set _ credentials _ file (username ) )中,API _ key='。 3 .脱机使用importplotlyfromplotly.graph _ objsimportscatter,layoutplotly.offline.init _ notter的py.iplot是ipython nn

5 .散点图和折线图基本散点图:

importplotly.offlineaspyfromplotly.graph _ objsimportscatter,layoutimportplotly.graph _ objsasgopy.init _ noteboboteboborte

可以改变模式,变成散点图:

trace=go.scatter (x=[ 1,2,3 ],y=[ 1,2,3 ],marker=dict(color=['red ',' blue ',' green'] ' ),sid

trace=go.scatter (x=[ 1,2,3 ],y=[ 1,2,3 ],marker=dict(color=['red ',' blue ',' green'] ' ),sid

6 .图例和图例位置trace1=go.scatter (name=' lenge D1 ',x=[ 1,2 ],y=[ 2,1 ] ) trace2=go.scatter ) name='lengeD2

在点上加上文字:

trace1=go.scatter (x=[ 1,2,3 ],y=[ 1,2,3 ],text=['A ',' b ',' C'],textposition='top center

增加: plotly.Scatter的设置

7 .坐标轴trace=go.scatter (x=[ 1,2,3,4 ],y=[ 1,2,3,6 ] ) axis_template=dict ) showgrid=true,# me

有关坐标轴设置参数的详细信息,请参阅: plotly坐标轴设置

8.heat map trace=go.heat map (z=[ 1,2,3,4 ],[ 5,6,7,8 ] ) data=[trace]py.IPlot ) data ) )。

8.bar chart trace=go.bar (x=[ 1,2 ],y=[ 1,2 ],marker=dict(color=['#ff0000 ',' #00FF00'] ',) ) )

其他设置: plotly.Bar

9 .填充区域trace=go.scatter (x=[ 1,2,6 ],y=[ 1,2,0.5 ],fill='tonexty ',fillcolor='#FF0 ' ) ) data=[ data ]

10 .直方图trace=go.histogram (x=[ 1,2,3,3,3,4,5 ],marker=DICT(color=['#f0f ',' f0 ',' 0ff ' )

11 .绘制地图trace=go.scatter geo (lon=[ 100,400 ],lat=[ 0,0 ],marker=dict ) color=['red ',' blue'],sscat

12. 3D表面图trace=go.surface (color scale=' viridis ',z=[ 3,5,8,13 ],[ 21,13,8,5 ] ) data=[trace]

13、箱型图(Box-plot ) trace=go.box ) x=[ 1,2,3,3,4,5 ] (data=[ trace ] py.IP lot ) data ) )

14 .绘制地图trace=go.choropleth (locations=[ ' az ',' ca ',' VT'],locationmode='USA-states ',color scale=

15. 3D点阵图trace=go.scatter 3d (x=[ 9,8,5,1 ],y=[ 1,2,4,8 ],z=[ 11,8,15,3 ],mode='lines )

16. 2维historgramtrace=go.histogram 2d (x=[ 1,2,3,3,4,5 ],y=[ 1,2,2,3,3,3,4,5 ] ) data=[ttta]

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。