Python - 如何在散景中为我的 vbar 添加注释?

Python - How to add annotation to my vbar in bokeh?

这是下图的代码

x= np.linspace(0.5, 6, 5)
y= rf[:5]

p_importance =figure()

p_importance.vbar(
    x = x,
    top = y,
    width = 1
)

我的列表保存在这里,如何添加下面的作为图例

 new_labels = list(rf[:5].index)

没有内置的方法可以做到这一点。您将需要使用自定义 TickFormatter 并将标签传递给它。以下问题使用 FuncTickFormatter.

How do I use custom labels for ticks in Bokeh?