Bokeh vẽ đường cong sin/cos mượt mà nhờ NumPy, phù hợp demo tín hiệu, vật lý.
Cài đặt & Phụ thuộc
pip3 install bokeh
conda install bokeh
# NumPy, Pillow, Jinja2, PyYAML, Six, Tornado, python-dateutil
Ví dụ: Sóng sin đơn giản
from bokeh.plotting import figure, output_file, show
import numpy as np
import math
x = np.arange(0, math.pi * 4, 0.1)
y = np.sin(x)
output_file("sample.html")
p = figure(title="Sóng sin đơn giản", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend_label="sine", line_width=2)
show(p)
Kết quả

Giải thích
np.arangetạo mảng x từ 0 đến 4π bước 0.1.np.sintính giá trị y.p.linevẽ đường nối các điểm,legend_labelhiển thị chú thích.
Mở rộng: Thêm p.line(x, np.cos(x), color="red", legend_label="cosine") để so sánh sin/cos.