2016-07-29 71 views
1

有沒有辦法刪除工具提示上的小黑色指針箭頭(指示當point_policy='follow_mouse'時鼠標的位置)? 任何幫助表示讚賞如何刪除工具提示上的箭頭從散景圖

enter image description here

+0

不知道如果不修改散景源代碼是否可能。您可以設置'hover.attachment = None',但會禁用點策略。 –

回答

1

答案是不是目前這方面的任何配置選項,散景0.12.1的。


但是,以下是一些可能有用的附加信息。我會鼓勵你打開一個問題有關項目問題跟蹤這一潛在功能的討論:

https://github.com/bokeh/bokeh/issues

這是可能的,這可能與一些CSS技巧來完成,但我不知道某些。或者,現在也可以用您自己的自定義擴展名來擴展Bokeh。你可以找到更多相關信息寫在這裏自定義擴展:

http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

然而,這至少是一個較爲複雜的任務,可能迫使那種背和問題,並幫助該StackOverflow上是不適合對於。請隨時停止該項目mailing listgitter chat channel的幫助。

1

作爲散景0.12.2的,存在選項用於:

hover.show_arrow = False 

這是一個完整的例子中,從official documentation採取:

#!/usr/bin/env python 
# coding: utf-8 
# 

from bokeh.plotting import figure, output_file, show 
from bokeh.models import HoverTool 


def main(): 
    # prepare some data 
    x = [1, 2, 3, 4, 5] 
    y = [6, 7, 2, 4, 5] 

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

    # create a new plot with a title and axis labels 
    p = figure(title="simple line example", x_axis_label='x', y_axis_label='y', tools='hover') 

    # add a line renderer with legend and line thickness 
    p.line(x, y, legend="Temp.", line_width=2) 

    # hover 
    hover = p.select_one(HoverTool) 
    hover.point_policy = "follow_mouse" 
    hover.tooltips = [ 
     ("Name", "@name"), 
     ("Unemployment rate)", "@rate%"), 
     ("(Long, Lat)", "($x, $y)"), 
    ] 
    # disable tooltip arrow 
    hover.show_arrow = False 

    # show the results 
    show(p) 

    return 0 

if __name__ == '__main__': 
    exit(main()) 

(對於歷史)

由於bigreddot說,我打開issue,我做了patch禁用箭頭。如果被接受,您將能夠禁用箭頭:

hover.show_arrow = False