Hello, I am trying to access the annotations in a figure.
The reference guide says that p.renderers
gives “A list of all renderers for this plot, including guides and annotations in addition to glyphs.”
However, it seems to me that it only gives the glyph renderers.
How can I access the arrow renderer in this case?
from bokeh.models import Arrow, NormalHead, OpenHead, VeeHead
from bokeh.plotting import figure, output_file, show
output_file("arrow.html", title="arrow.py example")
p = figure(width=600, height=600)
p.circle(x=[0, 1, 0.5], y=[0, 0, 0.7], radius=0.1, color="navy")
p.add_layout(Arrow(end=OpenHead(line_color="firebrick", line_width=4),
x_start=0, y_start=0, x_end=1, y_end=0))
p.line([0.2, 0.2, 0.2, 0.2, 0.2], [0.1, 0.2, 0.3, 0.4, 0.5])
print(len(p.renderers)) # Gives 2 the circles and lines