散景标签不支持多行

时间:2018-01-11 08:56:39

标签: label bokeh multiline

案例:\n多行。

我认为需要对散景文本进行相同的修改。

from bokeh.io import output_file, show
from bokeh.models import Label
from bokeh.plotting import figure

output_file("text.html")

p = figure(x_range=(0, 5))
p.text(x=[1,2,3], y = [0,0,0], text=['hello\nworld!', 'hello\nworld!', 'hello\nworld!'], angle = 0)

label = Label(x=2, y=-0.5, 
text='label\nworld',render_mode='css',border_line_alpha=0.5,
                background_fill_alpha=0.5)

p.add_layout(label)

show(p)

enter image description here

1 个答案:

答案 0 :(得分:0)

自版本0.12.13起,多行文字仅受text字形支持。如果您要求将其添加到Label,请在GitHub上发出功能请求问题。