Hi,
I would like to place a BoxAnnotation on a figure with a categorical axis,
but can’t figure out how to specify the exact location on the axis.
Any help is very much appreciated.
The BoxAnnotation in the picture was placed with help of a numerical axis location.
p_normal = figure(y_range=scales, x_range=[25,110], plot_width=w, plot_height=h, toolbar_location=None, title=‘Normal’)
for scoring_variable in scored_variables[1:]:
normal_and_patho_curves = make_ridge(scoring_variable, source_data, x)
p_normal.patch(‘x’, ‘y_normal’, alpha=0.3, line_color=‘black’, source=normal_and_patho_curves, color=‘lightsteelblue’)
ValueError: expected an element of either Auto or NumberSpec(String, Dict(Enum('expr', 'field', 'value', 'transform'), Either(String, Instance(Transform), Instance(Expression), Float)), Float), got ['Lacunes']
p_normal.text(27, y=dodge(‘text’, 0.8, range=p_normal.y_range), text=‘text’, source=ColumnDataSource(data=dict(text=scored_variables[1:])), **text_props)
p_normal.add_layout(BoxAnnotation(top=[‘Lacunes’))
``
Thanks!!