
Hello,
I am making a plot with two line graphs and using a secondary y-axis. However, the primary y-axis on the left automatically puts 0 slightly above the bottom of the graph where the secondary y-axis puts 0 on the very bottom of the graph.
Here is my code:
x = list(europe[europe.location == coun][‘datetime’].iloc[-660:])
y = list(europe[europe.location == coun].iloc[-660:].new_cases_smoothed)
y2 = list(europe[europe.location == coun].iloc[-660:].new_deaths_smoothed)
us = figure(title=coun, plot_height=400, plot_width=1000, x_axis_type="datetime", min_border = 10)
us.line(x, y, color="blue", legend_label="7 Day Case Average", alpha=0.45)
us.extra_y_ranges = {"foo": Range1d(start=-10, end=europe[europe.location == coun]
.iloc[-660:].new_deaths_smoothed.max() + 100)}
us.line(x, y2, color="orange", y_range_name="foo", legend_label="7 Day Death Average")
us.add_layout(LinearAxis(y_range_name="foo"), 'right')
us.xaxis.ticker.desired_num_ticks = 15
us.legend.location = "top_left"
So you can manipulate this with the start parameter for Range1d but that is pretty cumbersome when making multiple plots. Is there any way to automatically put 0 for both y-axises at the same level?
Here is an expample.
Thank you!
Andrew







