Matplotlib doesn't give me the visualisation I want
I like the interactive features of Bokeh and I would like to see if someone was able to get it running inside Google Colab?
I installed the library (from the notebook itself) and it showed the installation is successful
!pip install bokeh
but when I use it. It doesn't show anything (not even an error). Just blank output. When I check chrome's Javascript console, I see the follwoing
Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing
There's a Bokeh sample in the charts example notebook.
I suspect the important bit you'll need to add is:
from bokeh.io import output_notebook
output_notebook()
And most importantly output_notebook()
must be called inside the same cell
I made a library to make it easier to use bokeh in Colab
First install it
!pip install kora
Then your can plot a figure easily
from kora.bokeh import figure
p = figure(100, 200) # h, w
p.line([1, 2, 3, 4], [6, 7, 2, 4])
p # display itself, don't need show()
If you call from kora import bokeh
, it can work the same as import bokeh
. Or you can use them together as well. What I did is just create _repr_html_()
that help display the Figure object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With