Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share x-axis between Bokeh plots

Tags:

python

bokeh

In matplotlib you can share the x-axis between plots like so:

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?

like image 567
Jonas Byström Avatar asked Aug 20 '18 13:08

Jonas Byström


1 Answers

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)
like image 122
bigreddot Avatar answered Oct 03 '22 06:10

bigreddot