为什么 Bokeh 有以下错误消息?
Why Bokeh has the following error msg?
我正在尝试按照 udemy 教程进行操作,运行 出现以下错误:
散景错误
试图通过 运行 下面的代码在 html 中检索 属性 的 属性 值,而没有指定值 。
有人知道为什么会这样吗?谢谢!!
from bokeh.plotting import figure
from bokeh.io import output_file, show, gridplot
#from bokeh.sampledata.periodic_table import elements
from bokeh.models import Range1d, PanTool, ResetTool, HoverTool,
ColumnDataSource, LabelSet
import pandas
from bokeh.models.annotations import Span#assess object within
annotations
#prepare the output file
output_file("layout.html")
x1,y1=list(range(0,10)),list(range(10,20))
#create a new plot
f1=figure(width=250, plot_height=250, title="Circles")
f1.circle(x1, y1, size=10, color="navy", alpha=0.5)
#create a span annotation (a vertical reference line)
span_4=Span(location=4,dimension='height',line_color='grenn',
line_width=2)
#define where to add the span_4 object instance, add_layout method
f1.add_layout(span_4)
#create a box annotation
box_2_6=BoxAnnotation(left=2,right=6,fill_color="firebrick",
fill_alpha=0.3)
f1.add_layout(box_2_6)
#show the results
show(f1)
这似乎是因为打字错误 - line_color='grenn'
应该是 line_color='green'
。你是对的,虽然这是一个无用的错误信息。我会尝试打开一个关于它的 GH 问题。
我正在尝试按照 udemy 教程进行操作,运行 出现以下错误: 散景错误 试图通过 运行 下面的代码在 html 中检索 属性 的 属性 值,而没有指定值 。
有人知道为什么会这样吗?谢谢!!
from bokeh.plotting import figure
from bokeh.io import output_file, show, gridplot
#from bokeh.sampledata.periodic_table import elements
from bokeh.models import Range1d, PanTool, ResetTool, HoverTool,
ColumnDataSource, LabelSet
import pandas
from bokeh.models.annotations import Span#assess object within
annotations
#prepare the output file
output_file("layout.html")
x1,y1=list(range(0,10)),list(range(10,20))
#create a new plot
f1=figure(width=250, plot_height=250, title="Circles")
f1.circle(x1, y1, size=10, color="navy", alpha=0.5)
#create a span annotation (a vertical reference line)
span_4=Span(location=4,dimension='height',line_color='grenn',
line_width=2)
#define where to add the span_4 object instance, add_layout method
f1.add_layout(span_4)
#create a box annotation
box_2_6=BoxAnnotation(left=2,right=6,fill_color="firebrick",
fill_alpha=0.3)
f1.add_layout(box_2_6)
#show the results
show(f1)
这似乎是因为打字错误 - line_color='grenn'
应该是 line_color='green'
。你是对的,虽然这是一个无用的错误信息。我会尝试打开一个关于它的 GH 问题。