tho*_*olf 34
从Bokeh 0.11.1开始,轴上的用户指南部分现在显示如何编辑现有轴的属性.这样做的方法与以前一样:
p = figure(width=300, height=300, x_axis_label='Initial xlabel')
p.xaxis.axis_label = 'New xlabel'
Run Code Online (Sandbox Code Playgroud)
这是您可以使用CustomJS以下方法更改轴标签的方法:
p = figure(x_axis_label="Initial y-axis label",
y_axis_label="Initial x-axis label")
# ...
# p.xaxis and p.yaxis are lists. To operate on actual the axes,
# we need to extract them from the lists first.
callback = CustomJS(args=dict(xaxis=p.xaxis[0],
yaxis=p.yaxis[0]), code="""
xaxis.axis_label = "Updated x-axis label";
yaxis.axis_label = "Updated y-axis label";
""")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
27041 次 |
| 最近记录: |