☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Independent extra ranges in one figure

Community Supportcustomjsbokeh
Point_Lamont
Point_Lamont

I am a bit new to bokeh.
I have this sample code from the internet

from bokeh.plotting import output_file, figure, show
from bokeh.models import LinearAxis, Range1d

x = [1,2,3,4,5]
y = [1,2,3,4,5]
y2 = [10,9,8,7,6]
y3 = [23,24,25,26,27]

output_file("twin_axis.html")

p = figure(x_range=(0,6), y_range=(0,6))

p.circle(x, y, color="red")

p.extra_y_ranges = {"foo1": Range1d(start=0, end=11)}
p.hbar( right=x,y=x, color="blue", y_range_name="foo1")
p.add_layout(LinearAxis(y_range_name="foo1"), 'left')


p.toolbar_location ="above"
show(p)

I want to stick the hbar to the left side of the plot even panning the figure left or right.
Can anybody help me?
Sorry if it was already answered.

⌁   Link to post
Bryan
Bryan

This is not presently supported. Twin axes always pan/zoom together in order to preserve their initial scale relationship. I thought there was an open issue about this, but I was not able to locate it. Please feel free to open a GitHub Issue to request this as a new feature (but note that it may be closed as a duplicated in case an old issue is ever discovered).

⌁   Link to post

End of archived discussion · Replies are disabled