บทนำ
Bokeh ให้ Glyphs หลากหลายรูปทรงสำหรับ Scatter plots เช่น วงกลม, วงกลมขวาง, วงกลมครอส ช่วยสื่อสารข้อมูลเชิงปริมาณได้ชัดเจน
การติดตั้ง
pip3 install bokeh conda install bokeh
Dependencies
Numpy, Pillow, Jinja2, Packaging, Pyyaml, Six, Tornado, Python-dateutil
ตัวอย่างโค้ด
from bokeh.plotting import figure, output_file, show plot = figure(plot_width=300, plot_height=300) plot.circle(x=[1, 4, 6], y=[3, 7, 8], size=20, fill_color='red') plot.circle_cross(x=[2, 4, 5], y=[3, 8, 11], size=20, fill_color='black', fill_alpha=0.2, line_width=2) plot.circle_x(x=[5, 3, 2], y=[2, 1, 7], size=20, fill_color='green', fill_alpha=0.6, line_width=2) show(plot)
คำอธิบาย
circle: วงกลมทึบcircle_cross: วงกลมพร้อมเครื่องหมาย +circle_x: วงกลมพร้อมเครื่องหมาย xรองรับ
fill_alphaความโปร่งใส และline_width