函数:vbar绘制垂直条形图,hbar绘制水平条形图。
vbar(x,top,width,**kwargs)
top为长方形高度,width为长方形宽度。
from bokeh.io import output_notebook,show
from bokeh.plotting import figure
from bokeh.palettes import Spectral6#调色板
fruits=['Apple','Banana','Orange','Pear','Grapes']
counts=[7,4,9,1,5]
p=figure(x_range=fruits,plot_height=250,y_range=(0,10),title='Fruit Counts')
p.vbar(x=fruits,top=counts,width=0.9,color=Spectral6)
show(p)