python - Bokeh 弃用警告 : Setting a fixed font size value as a string 'text_font_size' is deprecated

标签 python bokeh

/Library/Python/2.7/site-packages/bokeh/properties.py:363: DeprecationWarning: Setting a fixed font size value as a string 'text_font_size' is deprecated, set with value('text_font_size') or ['text_font_size'] instead super(HasProps, self).setattr(name, value)

运行此代码时收到此警告:

myfig.text(x=[i], y=[.5], text=["abc"], text_align='center', text_font_size=['10pt'], text_color='#CDEFCC')

你能帮忙吗?我该如何摆脱它?

最佳答案

看起来这是 Bokeh 的一个活跃错误。有一个GitHub issue about it 。以下是响应的片段:

Hi @marcomayer looks like you found a little bug. The "list" syntax may go away anyway. You can set values like this, however:

from bokeh.properties import value
p.axis.major_label_text_font_size=value("8pt")

For a little context, the reason for the deprecation is that string values for data specs are, in every other context, interpreted as column data source column names. This changes brings consistency to the interface.

关于python - Bokeh 弃用警告 : Setting a fixed font size value as a string 'text_font_size' is deprecated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31486415/

相关文章:

python - python中的矩阵直积保留索引

python - 在 Bokeh 中隐藏图例旁边的注释

python - Bokeh 流轴

python - Bokeh - 从 BoxZoomTool/ResetTool 触发 on_change 回调

python - 在 python 中绘制轨道轨迹

python - 使用 Python 2.7.3 的自动背景转换器不起作用,但它应该

python - 有没有办法以交互方式关闭 python `Bokeh` 图中的图例

python - 如何更改 Bokeh 使用的 Python 版本?

python - 具有相同颜色的散点图和等高线图

python - 如何使用 pyQT 复制此 tkinter 滚动行为?