VisPy OpenGL库高性能的交互式2D/3D数据可视化

VisPy简介

VisPy,Python第三方库。VisPy通过OpenGL库利用现代图形处理单元(GPU)的计算能力来显示非常大的数据集,可以进行具有数百万点的高质量交互式科学绘图、实时数据的直接可视化,及三维模型的快速交互式可视化。

VisPy应用实例

import numpy as np

from vispy import plot as vp
from vispy.io import load_data_file

data = np.load(load_data_file('electrophys/iv_curve.npz'))['arr_0']
time = np.arange(0, data.shape[1], 1e-4)

fig = vp.Fig(size=(800, 800), show=False)

x = np.linspace(0, 10, 20)
y = np.cos(x)
line = fig[0, 0].plot((x, y), symbol='o', width=3, title='I/V Curve',
                      xlabel='Current (pA)', ylabel='Membrane Potential (mV)')
grid = vp.visuals.GridLines(color=(0, 0, 0, 0.5))
grid.set_gl_state('translucent')
fig[0, 0].view.add(grid)


if __name__ == '__main__':
    fig.show(run=True)

VisPy Github统计数据

Vispy is licensed under the terms of the (new) BSD license

Github 3.2k stars

VisPy安装命令

pip install --upgrade vispy 或 conda install -c conda-forge vispy

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.