我有一堆散景hbar 图,其中 y 轴刻度非常长:有些甚至比这更糟糕。我可以将它们布局在图中,还是有其他方法可以处理这个问题?
1 回答
![?](http://img1.sycdn.imooc.com/545869470001a00302200220-100-100.jpg)
斯蒂芬大帝
TA贡献1827条经验 获得超8个赞
扩展对问题的评论:
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)
添加回答
举报
0/150
提交
取消