1

This is the code for the following graph

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

p_importance =figure()

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

enter image description here

My list is saved here, how to add the following as a legend

 new_labels = list(rf[:5].index)
  • Can you show what the value of `rf` is? – Yserbius Feb 12 '18 at 15:30
  • @Yserbius it is of type pandas.core.series.Series. and I accessed the contents using .index and .values. I want to use the .index for the legend –  Feb 12 '18 at 15:45

1 Answers1

0

There's no built in way to do it. You will need to use a custom TickFormatter and pass along the labels to it. The following question does it using FuncTickFormatter.

How do I use custom labels for ticks in Bokeh?

Yserbius
  • 1,375
  • 12
  • 18