Label/Text Not Appearing on X-Axis in Bokeh 3.7

Hi,

I’m trying to add a dynamic text label on the x-axis of my plot, but the text simply won’t appear.
It was working on bokeh 3.6 but stopped working on 3.7

from bokeh.plotting import figure, show
from bokeh.io import output_file
from bokeh.models import HTMLLabel
import os

output_file(os.path.join(os.getcwd(), "my_plot.html"))

p = figure(width=400, height=400)
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 15], legend_label="Temp", line_width=2)
x_label = HTMLLabel(x=0,
                    y=400,
                    text="Sample Label",
                    text_color="white",
                    level='overlay',
                    x_units='canvas',
                    y_units='canvas')
p.add_layout(x_label)

show(p)

I tried label, HTMLLabel but all getting clipped and not appearing as soon as outside canvas.
Is there a model that appears on x-axis or any other solution?

vincent

Hi @VincentP If you change to y=200 then it becomes obvious that the label is now being cropped to the central plot area, which should not happen for the overlay level.

There was a lot of work around labels for 3.7.x to support improvements for accessibility, but with any big changes there is always the possibility of regressions being introduced. Please file a GitHub Issue to report this bug.