我明白你的問題,我想。您在說,默認情況下,工具面板將包含幫助工具。從頭開始指定所有工具時,默認情況下不包括幫助工具。
如果生成的情節不指定任何工具,然後列出對劇情的所有工具:
p.tools
>>>>
[PanTool(id='450f2e26-e0e5-4d90-89c4-44d20f2f688b', ...),
WheelZoomTool(id='84011ce1-4f73-4abb-abd1-26a830b70635', ...),
BoxZoomTool(id='adbfb29a-aa7d-4883-8f8f-d12b7c5af139', ...),
SaveTool(id='ff6ba8bb-c487-418d-82e5-28ff0402e2d6', ...),
ResetTool(id='dfac2559-da4c-4902-829d-f795ee0bfd56', ...),
HelpTool(id='1141330c-e9ff-4e5b-a737-3517c24f263e', ...)]
所以你可以看到有一個helptool。也正是在文件 http://bokeh.pydata.org/en/latest/docs/reference/models/tools.html#bokeh.models.tools.HelpTool
因此你可以導入這個工具,它以兩種方式添加到情節:
from bokeh.plotting import figure, output_file, show
from bokeh.models import HelpTool
output_file("toolbar.html")
# create a new plot with the toolbar below
p = figure(plot_width=400, plot_height=400,
title=None, toolbar_location="below", tools="pan,wheel_zoom,box_zoom,reset")
p.add_tools(HelpTool())
p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
show(p)
或者更簡單地說:
from bokeh.plotting import figure, output_file, show
output_file("toolbar.html")
# create a new plot with the toolbar below
p = figure(plot_width=400, plot_height=400,
title=None, toolbar_location="right",tools = "pan,wheel_zoom,box_zoom,reset,help")
p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
show(p)
您可以添加更多一些有關該問題的詳細信息以及您想要實現的內容。這太模糊了。 – Anthonydouc
哦,只是測試了一下,我發現了一個散景問題。我無法使用上面的解決方案來獲取「?」我將報告它併爲散景人創建測試代碼。 – pierre
最後的評論,如果你沒有配置圖()中的工具欄,你會得到「?」但是如果你選擇你的工具,那麼「?」消失。這給了這個問題的答案。有時候只是通過問它有所幫助。謝謝安東尼 – pierre