pythonic生物人

又一个Jupyter Notebook强大可视化插件!

bqplot是为Jupyter Notebook开发的一个交互插件,使用图层图形语法 (the Grammar of Graphics,了解该语法👉图层图形语法详解) ,但是丰富了交互图层,可满足丰富的交互式可视化需求,比如,

Image
Image
时间序列交互可视化

此外,在基础图形可视化上,bqplot功能也很强大,拥有类似matplotlib.pyplot的bqplot.pyplot。


安装

pip install bqplot
jupyter nbextension enable --py --sys-prefix bqplot

安装成功后,在Jupyter Notebook主页会出现👇 Image


快速使用

bqplot有两种实现可视化的方式

  • 面向对象方法: 使用图层图形语法 (the Grammar of Graphics) ,可满足更多个性化需求;
  • pyplot方法: 即bqplot.pyplot,类似matplotlib.pyplot;Image下面简单列举两个例子,

非交互图形

主要使用bqplot.pyplot实现,以bqplot.pyplot.hist为例,

import numpy as np
import bqplot.pyplot as plt

fig = plt.figure(title='Histogram by bqplot')
hist = plt.hist(sample=np.random.randn(100), bins=10, colors=['#01a2d9'])
fig

Image

交互图形

在图形中实现平移、缩放、选择等交互功能,

Image
气泡图交互可视化

更多移步:GitHub:https://github.com/bqplot/bqplot

-END-
再分享一份👉原创Python可视化教程:530张图形+8000行代码+详细代码注释+后续免费更新+学习交流群,部分目录,
Image
ImageImageImage
Image

每类图表包含详细代码+详细代码注释,多达8000行代码,例如,Image


如何加入学习?

👇(收费、务必备注:169)

Image

✅解锁获取6大权限:

  • 代码(复制即可运行)
  • 在线教程文档(方便后续更新)
  • 依赖数据(免费下载)
  • 微信交流群
  • 后续更新
  • 交流群定期包邮送最新统计、编程、AI类书籍