我们可以在HoloView中注册单击分散点吗?

2024-04-29 00:21:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在点击点的散点图上找到最近的邻居。 所以我需要知道点击了哪个点。下面我只是简单地显示所有的点和悬停

all_points = hv.Points(
    df_all_points, ['y', 'x'],
    ['x', 'y', 'z']
)

tooltips = [
    ('Index', '@z')
]
hover = HoverTool(tooltips=tooltips)

all_points.opts(
    tools=[hover], color='black',
    line_color='black', size=10,
    width=width, height=height, 
    show_grid=True)

那么,有可能用全息视图来实现这一点吗


Tags: dfindexallwidthpointscolorblackhv