问题
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:
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
回答2:
This 'text' functionality falls under 'glyphs': you'll find the page here
来源:https://stackoverflow.com/questions/30696486/how-can-i-add-text-annotation-in-bokeh