I have constructed a bokeh plot which I run in a Jupyter notebook. It displays "classic" glyphs, as well as BoxAnnotations that enable me to highlight periods of time depending on status (see image below).

What annoys me is that the BoxAnnotations seem to always be in the foreground, and therefore prevent users from clearly seeing colors.
I tried to switch the commands to add the annotations and the glyphs, but without success.
Is there any way to push the BoxAnnotation to the background, or are layouts always in the foreground?
Is there any other way to achieve the plotting I would like to produce?
You can try adding level="underlay" when you create your BoxAnnotation:
BoxAnnotation(..., level="underlay")
This is a feature of the Bokeh Annotation base class, where you can specify any of the following levels: image, underlay, glyph, guide, annotation, overlay I believe they are in incremental order from background -> foreground.
They have a brief snippet of it in the Plots section of their user-guide. Though I do find the documentation of it to be a little lacking.
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