gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 04:37:25 25 4
gpt4 key购买 nike

/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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com