label - Bokeh 标签不支持多线

标签 label bokeh multiline

案例:多线 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/

相关文章:

c++ - 是否可以在 Cocos2d-x 中更改标签字体大小?

label - 如何使用 %n - 字段值在信息中插入标签?

javascript - D3 力导向图节点上的标签/文本

javascript - Bokeh div 小部件,通过按按钮更改文本

html - 正则表达式抓取表单标签内容不起作用

iPhone 标签未更新

找不到 Python Bokeh 依赖项

javascript - BokehJS 标题文本对齐

Android TextView 不在 ListView 中做换行(多行文本)

python - 使用 Python Selenium 实现 WhatsApp 的多行消息