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.
Bokeh creates the HTML file when you call the show() function. This function also automatically opens a web browser to display the HTML file. If you want Bokeh to only generate the file but not open it in a web browser, use the save() function instead.
Matplotlib, seaborn, ggplot, and Pandas¶Uses bokeh to display a Matplotlib Figure. You can store a bokeh plot in a standalone HTML file, as a document in a Bokeh plot server, or embedded directly into an IPython Notebook output cell. Parameters: fig (matplotlib.
Bokeh is a Python library for creating interactive visualizations for modern web browsers. It helps you build beautiful graphics, ranging from simple plots to complex dashboards with streaming datasets.
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
This 'text' functionality falls under 'glyphs': you'll find the page here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With