python 第三方绘图库_D3py首页、文档和下载 - 基于 D3 的 Python 绘图库 - OSCHINA - 中文开源技术交流社区...

D3py 是一个基于 D3 的 Python 绘图库,可以像 D3 那样画出可交互的漂亮图形。

D3py 的目的是把来自命令行或者脚本的数据画到浏览器窗口,d3py 通过构建两个优秀的包来实现这一点。 第一个是 d3.js(Mike Bostock),它是一个用于创建数据驱动文档的 JavaScript 库,允许将任意 svg 放置到浏览器窗口中。 第二个是使用 DataFrame 数据结构的 pandas Python 模块(Wes Mckinney)。

示例

import d3py

import pandas

import numpy as np

# some test data

T = 100

# this is a data frame with three columns (we only use 2)

df = pandas.DataFrame({

"time" : range(T),

"pressure": np.random.rand(T),

"temp" : np.random.rand(T)

})

## build up a figure, ggplot2 style

# instantiate the figure object

fig = d3py.PandasFigure(df, name="basic_example", width=300, height=300)

# add some red points

fig += d3py.geoms.Point(x="pressure", y="temp", fill="red")

# writes 3 files, starts up a server, then draws some beautiful points in Chrome

fig.show()

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值