Bokeh tạo biểu đồ cột tương tác, nhúng được vào web app (Flask/Django) và Jupyter.
Cài đặt
pip3 install bokeh
conda install bokeh
Ví dụ cơ bản
from bokeh.plotting import figure, output_file, show
xvals = ['label_1', 'label_2', 'label_3']
yvals = [56, 78, 99]
fig = figure(x_range=xvals, plot_width=400, plot_height=300)
cols = ['navy', 'cyan', 'orange']
fig.vbar(x=xvals, top=yvals, color=cols, width=0.5)
show(fig)
Kết quả

Giải thích
x_rangeđặt nhãn trục X dạng categorical.vbarvẽ cột dọc,toplà chiều cao,colortùy biến màu từng cột.
Mẹo: Thêm HoverTool(tooltips=[("Label", "@x"), ("Value", "@top")]) vào figure để hiển thị giá trị khi hover.