Bokeh Plots and Kyso
Use this snippet to make bokeh plots work seamlessly in Jupyter and Kyso.
from bokeh.plotting import figure, output_file, save
from IPython.display import IFrame
from IPython.core.display import display, HTML
import tempfile
def bokeh_show(plot):
tmp_output_filename = tempfile.NamedTemporaryFile(suffix='.html').name
output_file(tmp_output_filename)
save(plot)
f = open(tmp_output_filename, "r")
display(HTML(f.read()))p = figure(title="Bokeh test", plot_width=300, plot_height=300)
p.circle([1, 2], [3, 4])
bokeh_show(p)Last updated