12

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?

Community
  • 1
  • 1
mirthbottle
  • 722
  • 7
  • 20

1 Answers1

31

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')
Steven C. Howell
  • 16,902
  • 15
  • 72
  • 97
mirthbottle
  • 722
  • 7
  • 20