bokeh.plotting#

bokeh.plotting API 是 Bokeh 的**主要**接口,它允许您专注于将符号与数据相关联。它会自动为您组装带有默认元素(例如轴、网格和工具)的绘图。

from bokeh.plotting import figure, show

fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
counts = [5, 3, 4, 2, 4, 6]

p = figure(x_range=fruits, height=350, title="Fruit Counts",
           toolbar_location=None, tools="")

p.vbar(x=fruits, top=counts, width=0.9)

p.xgrid.grid_line_color = None
p.y_range.start = 0

show(p)

本参考指南章节针对不同的主要组件进行了细分