Bokeh vẽ scatter plot tương tác, hỗ trợ zoom, pan, hover, export PNG.
Cài đặt
pip3 install bokeh
conda install bokeh
Ví dụ cơ bản
from bokeh.plotting import figure, output_file, show
fig = figure(plot_width=500, plot_height=400)
fig.scatter([1, 3, 7, 5, 4, 9], [6, 5, 9, 8, 0, 1], marker="circle", size=20, fill_color="grey")
output_file('scatterplot.html')
show(fig)
Kết quả

Giải thích
scatter()vẽ điểm, tham sốmarker,size,fill_color.- Có thể truyền
source=ColumnDataSource(df)để vẽ từ DataFrame.
Mở rộng: Thêm HoverTool, thay đổi marker theo nhóm dữ liệu, thêm đường hồi quy.