小编Ark*_*ady的帖子

Python Bokeh:从图表中删除工具栏

我似乎无法从散景条形图中删除工具栏.尽管将tools参数设置为None(或False''),我总是以bokeh徽标和灰色线结束,例如使用以下代码:

p = figure(toolbar_location=None)
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试使用散景图时,它工作得非常好,工具栏也不见了,例如使用以下代码:

from bokeh.charts import Bar, output_file, show

# prepare some data
data = {"y": [6, 7, 2, 4, 5], "z": [1, 5, 12, 4, 2]}

# output to static HTML file
output_file("bar.html")

# create a new line chat with a title and axis labels
p = Bar(data, cat=['C1', 'C2', 'C3', 'D1', 'D2'], title="Bar example",
                xlabel='categories', ylabel='values', width=400, height=400,
                tools=None)

# show the results
show(p)
Run Code Online (Sandbox Code Playgroud)

有谁知道我做错了什么?

python bokeh

24
推荐指数
2
解决办法
1万
查看次数

标签 统计

bokeh ×1

python ×1