2017-10-19 6 views
0

を持っていない:「図」オブジェクトは、これはボケ味を使用して棒グラフを表示することになって、Pythonの2.7で、私のコードで何の属性「vbar」

from bokeh.io import show, output_file 
from bokeh.models import ColumnDataSource 
from bokeh.palettes import Spectral6 
from bokeh.plotting import figure 

output_file("Option Bundling.html") 

options= ['Option 1', 'Option 2', 'Option 1+2'] 
counts = [df3.get_value(select.value, select.value), df3.get_value(select2.value, select2.value), df3.get_value(select.value,select2.value) ] 

source = ColumnDataSource(data=dict(options=options, counts=counts, color=Spectral6)) 

p = figure(x_range=options_list, y_range=(0,1), plot_height=250, title="Option Bundling", 
     toolbar_location=None, tools="") 

p.vbar(x='options', top='counts', width=0.9, color='color', legend="Options", source=source) 

p.xgrid.grid_line_color = None 
p.legend.orientation = "horizontal" 
p.legend.location = "top_center" 

show(p) 

私はJupyterでそれを実行してみた場合、次のメッセージが表示されます:

AttributeError       Traceback (most recent call last) 
<ipython-input-29-a4eb97059982> in <module>() 
    14   toolbar_location=None, tools="") 
    15 
---> 16 p.vbar(x='options', top='counts', width=0.9, color='color', legend="Options", source=source) 
    17 
    18 p.xgrid.grid_line_color = None 

AttributeError: 'Figure' object has no attribute 'vbar' 

コードはbokehのドキュメントに由来し、私は変数のみを変更しました。それを動かすために私は何を変えることができますか?

答えて

0

vbarは最近追加されたものです。ほとんどの場合、インストールされているバージョンのBokehは古くなり、vbarを使用できるようにアップグレードする必要があります。何らかの理由でアップグレードできない場合は、quadrectが利用可能になります。

関連する問題