在Bokeh图表中共享X轴

10
在Matplotlib中,您可以在绘图之间共享x轴,如下所示:
plt.subplots(nrows=2, sharex=True)

我希望在Bokeh中做类似的事情,即当我缩放一个时,另一个也会跟随缩放等。 我该如何在Bokeh中实现这个功能?

1个回答

17

这在用户指南的连接图表部分有详细说明。您只需要共享区间对象:

p1 = figure()

# share just the x-range between these plots
p2 = figure(x_range=p1.x_range)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接