Jonas Byström
Jonas Byström

Reputation: 26189

Share x-axis between Bokeh plots

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?

Upvotes: 10

Views: 7751

Answers (1)

bigreddot
bigreddot

Reputation: 34618

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)

Upvotes: 17

Related Questions