Bokeh add label to second axis on the right

╄→尐↘猪︶ㄣ 提交于 2019-12-07 01:27:47

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!