散景多线图值工具提示

时间:2019-07-23 17:01:32

标签: python bokeh

我正在尝试使用Bokeh进行流线型绘制。 https://bokeh.pydata.org/en/latest/docs/gallery/streamline.html这是简化的示例。 由于我要绘制的列表是2d列表,因此该线本身具有值。 我想知道如何使用工具提示使折线图的值可见。这是我的错误。 enter image description here

这就是我想尝试enter image description here

的方式

我已将tooltipfigure.image()一起使用,指的是此示例https://bokeh.pydata.org/en/latest/docs/gallery/image.html

xs, ys = streamline.streamlines(x, y, data[..., 0].transpose(), data[..., 1].transpose(), density=3)


p1 = figure(x_range=(lo[0], up[0] ), y_range=(lo[1], up[1]), tooltip=[("x", "$x"), ("y", "$y"), ("value", "$value")])
p1.multi_line(xs, ys, color="#ee6666", line_width=2, line_alpha=0.8)
show(p1)

0 个答案:

没有答案