Playing with bokeh (plotting library) from python

63 views
Skip to first unread message

Kiko

unread,
Jan 11, 2017, 6:04:09 PM1/11/17
to bry...@googlegroups.com
Hi all,

Bokeh 0.12.4 has been released some weeks ago and today I've played a little bit with it (only with bokehJS).

http://bokeh.pydata.org/en/latest/

The latest version doesn't work as it seems the Bokeh object is not fully loaded and some stuff is not directly accesible from the Bokeh object. So I used previous versions and here I left a link to a jsfiddle with an example. I've also used the new 'new' attribute added by Pierre some days ago.

https://jsfiddle.net/230v1zev/

I have no idea about how to place the chart in the place I want in the document. It is my first time toying with bokeh. It seems from python one can get the js code generated and the div where to embed the chart but I don't know how to provide a HTML tag id to control where I want the plot to be placed.

http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#components

Maybe I should ask in the bokeh ML.

Best.

Kiko

unread,
Jan 12, 2017, 10:33:16 AM1/12/17
to bry...@googlegroups.com
TL;DR, You have to pass the selector to the show that will render the plot: plt.show(p, "#myplot") where "myplot" is the id of a DIV element.. I've tried to use the DIV element obtained through brython but I get a nasty error (it seems related with JQuery).

Best.

Pierre Quentel

unread,
Jan 13, 2017, 2:27:24 AM1/13/17
to brython
Very nice ! Could you add the demo to the Brython gallery ?

Kiko

unread,
Jan 13, 2017, 2:31:45 AM1/13/17
to bry...@googlegroups.com
Of course.

I don't have much time these days but this is an easy task.

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/b4b617c9-48e5-428a-8613-827fc0c8aa94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages