简体   繁体   English

在散景图之间共享x轴

[英]Share x-axis between Bokeh plots

In matplotlib you can share the x-axis between plots like so: 在matplotlib中,您可以像这样共享绘图之间的x轴:

plt.subplots(nrows=2, sharex=True)

I would like to do something similar in Bokeh, where I zoom one, the other will follow, etc. How would I do that in Bokeh? 我想在Bokeh中做类似的事情,在其中我放大一个,然后再放大另一个,依此类推。在Bokeh中我将如何做?

This is documented in the Linking Plots section of the User's Guide. 用户指南的“ 链接图解”部分对此进行了说明。 You only need to share ranges objects: 您只需要共享范围对象:

p1 = figure()

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM