#!/usr/bin/env python # coding: utf-8 # ## 第6章 Bokehでグラフを描画しよう # # ### 6-3: グラフ描画の基礎 # In[1]: # リスト6.3.1:高レベルのインタフェースのインポート例 from bokeh.charts import Line, output_notebook, show # In[2]: # リスト6.3.3:output_notebook関数の実行 output_notebook() # In[3]: # リスト6.3.5:インスタンス作成 p = Line([1, 2]) # In[4]: # リスト6.3.7:グラフの調整 p.plot_height = 200 p.plot_width = 200 # In[5]: # リスト6.3.9:グラフ出力 show(p) # In[6]: # リスト6.3.11:HTMLファイルにグラフを出力する from bokeh.charts import output_file output_file("out.html") show(p) # In[7]: # リスト6.3.12:出力先を元に戻す from bokeh.io import reset_output reset_output() output_notebook() # In[ ]: