2017-05-04 47 views
0

我正在嘗試按照udemy教程進行操作,並遇到以下錯誤: 散景錯誤 嘗試通過運行下面的代碼,檢索html中屬性值爲的屬性值。爲什麼Bokeh有以下錯誤消息?

有沒有人有線索爲什麼發生?謝謝!!

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) 

回答

3

看起來是因爲輸入錯誤 - line_color='grenn'應該是line_color='green'。你說得對,這是一個無益的錯誤信息。我會盡力爲它開一個GH問題。

+0

啊。我糾正了它。非常感謝!! – Cai

相關問題