来自维护人员的注意:这个问题的细节涉及到bokeh.charts
应用程序接口,它已经过时并在几年前就被删除了。在现代Bokeh中,指定toolbar_location
__:
p = figure(toolbar_location=None)
过时的:
我似乎无法从bokeh条形图中删除工具栏。尽管tools参数设置为None (或False或''),但我总是以bokeh徽标和一条灰色线条结束,例如下面的代码:
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)
但是,当我用bokeh图尝试同样的方法时,它工作得很好,工具栏也消失了,例如下面的代码:
from bokeh.plotting import figure, output_file, show
output_file("line.html")
p = figure(plot_width=400, plot_height=400, toolbar_location=None)
# add a line renderer
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=2)
show(p)
有人知道我做错了什么吗?
发布于 2015-09-20 20:13:55
如果要删除徽标和工具栏,可以执行以下操作:
p.toolbar.logo = None
p.toolbar_location = None
希望这能解决你的问题
发布于 2015-08-23 23:42:11
在任何Bokeh绘图对象上,您都可以设置:
p.toolbar_location = None
https://stackoverflow.com/questions/32158939
复制相似问题