บทนำ
Horizontal Bar Chart ใช้เมธอด hbar ระบุ y, left, right, height เหมาะสำหรับหมวดหมู่ที่มีชื่อยาว
การติดตั้ง
pip3 install bokeh conda install bokeh
Dependencies
Numpy, Pillow, Jinja2, Packaging, Pyyaml, Six, Tornado, Python-dateutil
ตัวอย่างโค้ด
from bokeh.plotting import figure, output_file, show
fig = figure(plot_width=400, plot_height=200)
fig.hbar(y=[2, 5, 9, 1], height=1, left=0, right=[1, 6, 3, 9], color="Cyan")
output_file('bar_plot.html')
show(fig)คำอธิบาย
ใช้
hbarแทนvbarระบุ y (ตำแหน่ง), height (ความหนา), left/right (ขอบซ้าย/ขวา)