Bokeh inside Google Colab

前端 未结 3 779
孤街浪徒
孤街浪徒 2021-01-03 02:31

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 Go

3条回答
  •  甜味超标
    2021-01-03 02:46

    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.

提交回复
热议问题