I’m trying to setup a chart with two y axes, and I’m having trouble with the axis ranges.
pandas data frame; column are ‘x’, ‘y1’, ‘y2’
cds = ColumnDataSource(pd.df)
setup the plot
p = figure(…)
add the right y-axis
p.extra_y_ranges[‘y2axis’] = Range1d(start=0, end=100)
p.add_layout(LinearAxis(y_range_name=‘y2axis’), ‘right’)
add the line glyphs
p.line(x=x,y=y1, source=cds)
p.line(x=x,y=y2, source=cds, y_range_name=‘y2axis’)
what’s the correct syntax for autosetting the ‘y’ axis range from just the ‘y1’ column?
this used to be correct prior to 0.9 release, but 'sources" has been removed as an argument.
p.y_range = DataRange1d(sources=[cds.columns(‘y1’)])
``
The y_range is getting calculated by a union of the y1 and y2 data columns. I.e., y1 has data from 0-50; y2 has data from 35-100; the union is 0-100 shown on both axes. If I remove the y2 line, then I get the correct range (0-50) on the left axis.
Thanks,
Jeff

