问题
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')
来源:https://stackoverflow.com/questions/29267141/bokeh-add-label-to-second-axis-on-the-right