Bokeh add label to second axis on the right

2020-08-19 05:06发布

问题:

I am creating a bar chart using Bokeh, and I want to display 2 independent sets of data. I have added another y-axis to the right side of my plot using the following

bar2.extra_y_ranges = {"Mtons": Range1d(start=0, end=2000)}
bar2.add_layout(LinearAxis(y_range_name="Mtons"), 'right')

How do I add a label for the second axis?

回答1:

LinearAxis has a parameter axis_label. This can be set by editing the call to LinearAxis as follows:

bar2.add_layout(LinearAxis(y_range_name="Mtons", axis_label="Mt CO2e"), 'right')


标签: bokeh