user9238790
user9238790

Reputation:

Set the legend in a plot to have the name of a column in bokeh

Here is my code below, how can I make the legend take the name of the column in rf.index[0]. Simply passing rf.index[0] to legend creates a legend of the categories rather than the actual name of the column.

p1.line(
    x = 'x',
    y = rf.index[0],
    source=source,
    legend = ???,
    color = 'black'

)

Upvotes: 1

Views: 282

Answers (1)

user9238790
user9238790

Reputation:

Here is the answer!

legend = dict(value=rf.index[0])

source

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

Upvotes: 1

Related Questions