"Send to Back" Annotations

I’m building a bar graph chart and I want to use box annotations to specify different regions in my x domain. Problem is that I don’t want those box annotations obscuring my bar graph. I just want them chilling in the background so people can use the annotations as an aid to interpreting the bar data. Is there any way I can place those annotations “behind” the bar graph so they are only visible in the other empty area of the chart?

Set the level property of the annotation to "image" or "underlay"

That worked great. Can I ask how you knew about that? The user guide has the documentation for annotations and BoxAnnotation in particular and it doesn’t say anything about the level property. Forgive me for being a n00b, but where can users like me learn about those other properties?

1 Like

Well the immediate and unhelpful answer is that I wrote it. But more generally for question about specific properties and models, the most useful place is probably the reference guide, e.g.

annotations — Bokeh 2.4.2 Documentation

That said, in this case it’s still a little unfriendly— you would have to follow the link back to the Renderer base class to see the level property. (Which is also pretty sparse and brief). (Expanding and re-arranging the Reference Guide is a great place where a new contributor could make some very valuable contributions for the community.)

1 Like