可以在绘图内布局散景 y 刻度

我有一堆散景hbar 图,其中 y 轴刻度非常长:

https://img2.mukewang.com/651f76ff0001ab1f05340135.jpg

有些甚至比这更糟糕。我可以将它们布局图中,还是有其他方法可以处理这个问题?



饮歌长啸
浏览 93回答 1
1回答

斯蒂芬大帝

扩展对问题的评论:from bokeh.io import showfrom bokeh.models import ColumnDataSourcefrom bokeh.plotting import figureds = 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)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python