Hi, is it possible to perform linked panning on multiple twin axes plots?
Horizontal panning works fine since there’s only one x axis, but I’m stuck regarding how to get vertical panning to work for both the primary and second y axis plots. Running the sample code below and then panning up and down will make what I’m trying to describe much clearer.
Referencing the documentation from here:
Linked Panning: https://bokeh.pydata.org/en/latest/docs/user_guide/interaction/linking.html#linked-panning
Twin Axes: https://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#twin-axes
Extending on the twin axes example, here’s what I’m trying to do:
from numpy import pi, arange, sin, linspace
from bokeh.plotting import figure, show
from bokeh.models import LinearAxis, Range1d
from bokeh.layouts import gridplot
from bokeh.io import output_notebook
output_notebook()
x = arange(-2pi, 2pi, 0.1)
y1 = sin(x)
y2 = linspace(0, 100, len(y))
Plot 1
p1 = figure(x_range=(-6.5, 6.5), y_range=(-1.1, 1.1))
p1.circle(x, y1, color=“red”)
p1.extra_y_ranges = {“foo”: Range1d(start=0, end=100)}
p1.circle(x, y2, color=“blue”, y_range_name=“foo”)
p1.add_layout(LinearAxis(y_range_name=“foo”), ‘right’)
Plot 2
p2 = figure(x_range=p1.x_range, y_range=p1.y_range) # linked to p1
p2.circle(x, y1, color=“red”)
p2.extra_y_ranges = {“foo”: Range1d(start=0, end=100)} # how to link this part???
p2.circle(x, y2, color=“blue”, y_range_name=“foo”)
p2.add_layout(LinearAxis(y_range_name=“foo”), ‘right’)
show(gridplot([[p1], [p2]], plot_width=900, plot_height=300, toolbar_location=‘above’))
``