散景在右侧的第二个轴上添加标签 [英] Bokeh add label to second axis on the right

查看:63
本文介绍了散景在右侧的第二个轴上添加标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Bokeh 创建条形图,并且我想显示2组独立的数据.我已使用以下方法在我的图的右侧添加了另一个y轴.

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?

推荐答案

LinearAxis具有参数

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')

这篇关于散景在右侧的第二个轴上添加标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆