How can I add text annotation in Bokeh?

23.6k views Asked by At

I'm looking for Matplotlib type 1 text annotation in Bokeh, but I couldn't find it in the their user guide 2 or in the references.

1

There are 1 answers

0
queise On BEST ANSWER

As of version 0.12.2, to add text annotations you would use the "label" glyph.

from bokeh.models import Label

p = figure(...)

mytext = Label(x=70, y=70, text='here your text')

p.add_layout(mytext)

show(p)

Please find a full example in the documentation: http://docs.bokeh.org/en/latest/docs/user_guide/annotations.html#userguide-annotations