案例:多线 by \n
.
我认为需要对 Bokeh 文本进行相同的修改。
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
最佳答案
截至版本 0.12.13
多行文本仅支持 text
字形。如果您想请求将其添加到 Label
请在 GitHub 上提出功能请求问题。
关于label - Bokeh 标签不支持多线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48203055/