Bokeh: package Python trực quan hóa, mã nguồn mở, render HTML/JS → dashboard web.
Chuyển data source thành JSON cho BokehJS (TypeScript) render browser.
Biểu đồ tương tác (interactive) khác Matplotlib/Seaborn (static). Nhúng Flask/Django/Jupyter.
Dependencies: NumPy, Pillow, Jinja2, Packaging, PyYAML, Six, Tornado, python-dateutil.
Cài đặt: pip3 install bokeh | conda install bokeh
Hình chữ nhật tùy ý (arbitrary rectangles) vẽ bằng rect(): chỉ định center (x,y), width, height, angle.
Ví dụ
from math import pi
from bokeh.plotting import figure, output_file, show
output_file('rectanglesRandom.html')
p = figure(plot_width=400, plot_height=400)
p.rect(x=[1, 3, 5, 7], y=[1, 3, 5, 7], width=0.2, height=50, color="#CAB2D6", angle=pi/3, height_units="screen")
show(p)
Đầu ra

Giải thích
- Import math (pi), Bokeh plotting.
figure()width/height.output_file()file HTML.rect()vẽ hình chữ nhật xoay: center x/y, width=0.2, height=50 (screen units), color, angle=pi/3 (60°).show()hiển thị.