可以在图中布局散景 y 刻度

Possible to layout bokeh y-ticks inside plot

我有一堆 bokeh hbar 图,其中 y 轴刻度线很长:

有些甚至比这更糟。我可以将它们布置在内部情节中,还是有任何其他方式来处理这个问题?

扩展对问题的评论:

from bokeh.io import show
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure

ds = ColumnDataSource(dict(x=[1, 2, 3],
                           y=['a', 'b', 'c']))
p = figure(y_range=sorted(set(ds.data['y'])))
p.hbar(y='y', height=0.8, left=0, right='x', source=ds)
p.text(y='y', text='y', text_baseline='middle', x=0, x_offset=10, color='white', source=ds)
show(p)