数据可视化---plotly篇

本文介绍了使用Plotly进行数据可视化的几个基本示例,包括基础图表、箱型图和地图上的路径绘制,展示了Plotly如何作为一个强大的绘图库,支持Python等多种语言,易于初学者上手。
摘要由CSDN通过智能技术生成

plotly

https://plot.ly/python/ plotly是现代平台的敏捷商业智能和数据科学库,它作为一款开源的绘图库,可以应用于Python、R、MATLAB、Excel、JavaScript和jupyter等多种语言,主要使用的js进行图形绘制,实现过程中主要就是调用plotly的函数接口,底层实现完全被隐藏,便于初学者的掌握。

Basic Example
In [6]:
 
        
import plotly.plotly as py
import plotly.graph_objs as go
py . sign_in ( 'deamoncao' , '*******' ) # 注意:这里是plotly网站的用户名和密码
trace = go . Bar ( x = [ 2 , 4 , 6 ], y = [ 10 , 12 , 15 ])
data = [ trace ]
layout = go . Layout ( title = 'A Simple Plot' , width = 800 , height = 640 )
fig = go . Figure ( data = data , layout = layout )
py . image . save_as ( fig , filename = 'a-simple-plot.png' )
from IPython.display import Image
Image ( 'a-simple-plot.png' )
Out[6]:
In [22]:
 
        
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
y0 = np . random . randn ( 50 ) - 1
y1 = np . random . randn ( 50 ) + 1
trace0 = go . Box (
y = y0
)
trace1 = go . Box (
y = y1
)
data = [ trace0 , trace1 ]
py . iplot ( data )
Out[22]:

Fully Styled Box Plots

In [9]:
 
        
import plotly.plotly as py
import plotly.graph_objs as go
x_data
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值