Hi, trying to understand this behaviour.
I have 2 sources that share the same x axis range but their y values are drastically different. The actual values being plotted will be changing dynamically, so essentially what I’m after is for both axes ranges to “follow” the respective min/max range of the renderers assigned to them. What I’m noticing is that the primary (i.e. left) axis will, by default at least, “auto” scale not only to the renderer that’s being plotted on it, but to all the renderers. Compounding this, I can’t seem to figure out how to get the secondary (i.e. right) axis to follow the right renderer’s min/max values at all. I’ve played with the bounds property, and read about the “follow”/“follow_interval” properties as well but don’t really understand their usage/am unsure if/how they apply here.
I know I could just go nuclear and write my own CustomJS to do what I want here but wondering if something is built in that I’m completely missing?
Finally, the other thing that’s related to this: I’d like to be able to wheelzoom in on one y axis without that zoom applying to the other y axis. Need a way to “delink” the two from each other…
Sandbox example code:
from bokeh.plotting import figure, show
from bokeh.models import Scatter, Rect, ColumnDataSource, Range1d, LinearAxis
s_src = ColumnDataSource({'x':[1,2,3],'y':[1,2,3]})
r_src = ColumnDataSource({'x':[1,2,3],'y':[100,200,300]})
f = figure()
#could add start and end args to the Range1d here... but that would fix my right axis bounds (don't want that), and my left axis range would STILL follow the 'right' renderer
#so i don't think there's anything to do here?
f.extra_y_ranges={'r':Range1d()}
f.add_layout(LinearAxis(y_range_name='r'),'right')
sg = Scatter(x='x',y='y')
sr = f.add_glyph(s_src,sg)
rg = Rect(x='x',y='y',height=10,width=0.5)
rr = f.add_glyph(r_src,rg,y_range_name='r')
show(f)
As always thanks so much!