bokeh Python web交互式数据可视化库

bokeh简介

bokeh,Python第三方数据可视化库,通过bokeh的代码,可用现代web浏览器的快速轻松地创建交互式绘图、仪表板和数据应用程序。

bokeh应用实例

import numpy as np
from scipy.integrate import odeint

from bokeh.plotting import figure, show

sigma = 10
rho = 28
beta = 8.0/3
theta = 3 * np.pi / 4

def lorenz(xyz, t):
    x, y, z = xyz
    x_dot = sigma * (y - x)
    y_dot = x * rho - x * z - y
    z_dot = x * y - beta* z
    return [x_dot, y_dot, z_dot]

initial = (-10, -7, 35)
t = np.arange(0, 100, 0.006)

solution = odeint(lorenz, initial, t)

x = solution[:, 0]
y = solution[:, 1]
z = solution[:, 2]
xprime = np.cos(theta) * x - np.sin(theta) * y

colors = ["#C6DBEF", "#9ECAE1", "#6BAED6", "#4292C6", "#2171B5", "#08519C", "#08306B"]

p = figure(title="Lorenz attractor example", background_fill_color="#fafafa")

p.multi_line(np.array_split(xprime, 7), np.array_split(z, 7),
             line_color=colors, line_alpha=0.8, line_width=1.5)

show(p)

bokeh Github统计数据

BSD-3-Clause license

Github 18.4k stars

bokeh安装命令

pip install bokeh或 conda install bokeh

Python版本要求

bokeh 3.3.2 Requires: Python >=3.9

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


行业导航 / Python指南 :
























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