Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bokeh not showing in jupyter notebook

I am unable to plot even the most basic of Bokeh plots in Jupyter Notebook. I had a search and can see that this was a reported problem a little over a year ago but nothing since - is it still an issue for others?

from bokeh.io import output_notebook, show
from bokeh.plotting import figure

output_notebook()

p = figure(plot_width=400, plot_height=400)

p.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=15, line_color="navy", 
fill_color="orange", fill_alpha=0.5)

show(p)

I get the "BokehJS 0.12.10 successfully loaded." message, but not plot. Note that it outputs html files ok.

I've tried changing the environment variables using:

import os
os.environ['BOKEH_RESOURCES'] = 'inline'

But this has not effect either. It's bee a frustrating afternoon so any help would be appreciated!

like image 763
Mike Avatar asked Dec 23 '22 13:12

Mike


1 Answers

Running the lines below worked for me

from bokeh.resources import INLINE
import bokeh.io
from bokeh import *
bokeh.io.output_notebook(INLINE)
like image 199
Beri Shifaw Avatar answered Dec 26 '22 19:12

Beri Shifaw