旋转次要刻度标签以进行分类散景图 [英] Rotating minor tick labels for categorical Bokeh plot

查看:77
本文介绍了旋转次要刻度标签以进行分类散景图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Bokeh的多分类图中旋转主轴和副轴(类似于对主要刻度标签此处.当具有多个类别时,它们的标签/文本经常会被涂抹在一起.

I am trying to rotate the major- and the minor axis within a multi-categorical plot in Bokeh (similar to what is done for major tick labels here and done within matplotlib here. When having several categories, their labels/text often get smeared together.

Bokeh分类文档中汲取灵感使用Bokehs vbar功能对数据进行搜索,结果类似于

Taking some inspiration from the Bokeh documentation on Categorical Data the result, using Bokehs vbar functionality, would look something like

可以使用

p.xaxis.major_label_orientation = pi/4

但是我找不到任何实际方法来为未成年人做同样的事情...

Yet I can't find any way of actually doing the same for the minors...

? p.xaxis.minor[0]_label_orientation = pi/4 ?
? p.xaxis.minor[1]_label_orientation = pi/3 ?
...

任何想法都将不胜感激!

Any thoughts out there would be very much appreciated!

推荐答案

更新

此功能是在散景0.12.16中添加的,您现在可以执行以下操作:

This capability was added in Bokeh 0.12.16, you can now do:

p.xaxis.major_label_orientation = "vertical"
p.xaxis.subgroup_label_orientation = "normal"
p.xaxis.group_label_orientation = 0.8


<罢工> 在Bokeh 0.12.13中是不可能的,除第一个水平以外的其他水平的标签方向始终为parallel:


It's not possible in Bokeh 0.12.13, the orientation of labels for levels other than the first one is always parallel: https://github.com/bokeh/bokeh/blob/0.12.13/bokehjs/src/coffee/models/axes/categorical_axis.coffee#L89-L92

如果需要此功能,欢迎您通过功能请求创建GitHub问题.

You're welcome to create a GitHub issue with a feature request if you need this functionality.

这篇关于旋转次要刻度标签以进行分类散景图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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