# How to link plots with different axis

**URL:** <https://discourse.bokeh.org/t/how-to-link-plots-with-different-axis/2450>\
**Category:** Community Support\
**Created:** [September 13, 2017, 9:07pm UTC](https://discourse.bokeh.org/t/how-to-link-plots-with-different-axis/2450 "2017-09-13T21:07:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Massar](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/m/9de0a6/32.png) [@Marc\_Massar](https://discourse.bokeh.org/u/Marc_Massar)\
**Post date:** [September 13, 2017, 9:07pm UTC](https://discourse.bokeh.org/t/how-to-link-plots-with-different-axis/2450/1 "2017-09-13T21:07:22Z")

</div>

Hello,

How would I make two linked plots where the x axis are different (but have the same number of points), and I can pan and zoom are linked. By linked I mean that if I do a box zoom on e.g. the first 5 points on one plot, the other plot will also zoom on the first five points.

E.g. if I slightly modify the [linked brushing example](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/linking.html#linked-brushing) from the doc, I can link selecting data points between the two plots, but not zooming. I tried adding range arguments, but it does not work (which I expect of course).

import numpy as np

from [bokeh.io](http://bokeh.io) import output\_file, show

from bokeh.layouts import column

from bokeh.plotting import figure

from bokeh.models import ColumnDataSource

output\_file(‘Test.html’)

source = ColumnDataSource({x0=np.arange(10), x1=2\*np.arange(10), y=np.arange(10) \*\* 2})

p0 = figure()

p0.circle(‘x0’, ‘y’, source=source)

p1 = figure()

p1.circle(‘x1’, ‘y’, source=source)

p = column([p0, p1])

show(p)

---

<div class="post-metadata">

**Author:** ![Sebastien\_Roche](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/sebastien_roche/32/770_2.png) [@Sebastien\_Roche](https://discourse.bokeh.org/u/Sebastien_Roche)\
**Post date:** [September 14, 2017, 9:06pm UTC](https://discourse.bokeh.org/t/how-to-link-plots-with-different-axis/2450/2 "2017-09-14T21:06:11Z")

</div>

I do that by writting a callback for the box\_select tool. If your data is all in one source, you will have ‘linked’ selection with the box\_select tool. You can then update the ranges of different figures based on the selected values in different columns of the data source.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:12pm UTC](https://discourse.bokeh.org/t/how-to-link-plots-with-different-axis/2450/3 "2021-07-21T21:12:53Z")

</div>


