Live data from Hacker News

Bokeh – a Python interactive visualization library

bokeh.pydata.org

31–40 of 67 posts

Re: Bokeh – a Python interactive visualization library

#31

Since I have never really liked Matplotlib I would really like to learn Bokeh, but unfortunately its inability to export its visualizations in SVG or similar formats makes it kind of useless for me as a scientist wanting to publish my results.

I would suggest Plot.ly which is now open source and can export to html (with a lot of JavaScript which generates the SVG)

Re: Bokeh – a Python interactive visualization library

#32
post #15
post #9

Earlier quoted context omitted.

They're working on it, probably in a month or two you'll be able to do it: https://groups.google.com/a/continuum.io/forum/#!searchin/bo... At the current time you can export to png, or maybe export to svg in a roundabout manner, by turning html page into pdf, turning pdf into svg, etc.

A png isn't a vector format, so the important property of the SVG (or EPS, PDF) is lost. A vectorized bitmap is still a bitmap.

What resolution are you looking for in print? If you export your raster at 300 dpi, and enable lossless PNG compression, shouldn't it suffice for most print purposes?

Re: Bokeh – a Python interactive visualization library

#33
post #16

Since I have never really liked Matplotlib I would really like to learn Bokeh, but unfortunately its inability to export its visualizations in SVG or similar formats makes it kind of useless for me as a scientist wanting to publish my results.

If you're not wedded to Python, have a gander at Gnuplot. Despite its quirks, it's my favorite plotting tool.

+1 for gnuplot. Amazingly powerful and flexible, and exports to png, pdf, eps, latex, etc. Possibly outdated in some aspects but still unbeatable AFAIK.

That being said, this sounds nice for adding interactivity (sliders to vary parameters, that sort of stuff). Useful in presentations and the sort.

Re: Bokeh – a Python interactive visualization library

#34

"Bokeh is a Python interactive visualization library that targets modern web browsers for presentation." A description of how one gets from Python to a web browser display would be nice. Is there a translation from Python to Javascript somewhere? Is there a Python web server backend? Are there dynamic visual updates or does this thing just generate a static output like a .png file?

There is a full-featured javascript runtime "BokehJS" which is designed from the ground up to be driven by remote (aka server-side) models, which are sent over the wire as JSON. The server-side models are generated programmatically via Python, R, Scala, etc. The cool thing is that a lot of the interactivity is completely native in BokehJS, so you can build interactive Javascript visualizations from Python, and have an entirely static HTML document that embeds a lot of rich interactivity.

See, for instance, Sarah Bird's excellent GapMinder example: http://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blo...

When you move the slider, it generates JS events which drive model updates completely in the browser, which then update the objects that comprise the plot. All of that is built straight from Python, but there is no Python kernel running in the background.

Bokeh also lets you write your event handlers in Python, and reside on the server, and get called back automatically when the user interacts with the plot in some way. Check out this app for example: http://demo.bokehplots.com/apps/selection_histogram You can use the lasso tool to select some points, and that computes a new sub-histogram. Here is the entirety of the code for it: https://github.com/bokeh/bokeh/blob/master/examples/app/sele...

For more deep-dive on the architecture, you can start at this slide and walk through: http://www.slideshare.net/misterwang/bokeh-tutorial-pydata-s...

Or you can watch this webinar recording (start at the 19 minute mark): https://continuum-analytics.wistia.com/medias/f6wp9dam91

Re: Bokeh – a Python interactive visualization library

#35
post #32
post #15

Earlier quoted context omitted.

A png isn't a vector format, so the important property of the SVG (or EPS, PDF) is lost. A vectorized bitmap is still a bitmap.

What resolution are you looking for in print? If you export your raster at 300 dpi, and enable lossless PNG compression, shouldn't it suffice for most print purposes?

It still has limited resolution and a much higher storage footprint. Plotting charts is the vector graphics use case par excellence. Having svg support is a no brainer.

Re: Bokeh – a Python interactive visualization library

#36
post #30

Earlier quoted context omitted.

i believe the idea behind the name is that bokeh (python) is to data viz what bokeh is to photography - its a tool that brings the important data into focus.....

bokeh by definition is talking about the out of focus stuff, which is arguably the less important part of a shot.

Which brings in focus elements into sharper attention.

Re: Bokeh – a Python interactive visualization library

#37

"Bokeh is a Python interactive visualization library that targets modern web browsers for presentation." A description of how one gets from Python to a web browser display would be nice. Is there a translation from Python to Javascript somewhere? Is there a Python web server backend? Are there dynamic visual updates or does this thing just generate a static output like a .png file?

my question exactly. What does this do that I can't do with highcharts?

In the Dev Guide docs, there is a section about why we built our own Javascript charting library from the ground up:

http://bokeh.pydata.org/en/latest/docs/dev_guide/bokehjs.htm...

Re: Bokeh – a Python interactive visualization library

#38
post #35
post #32

Earlier quoted context omitted.

What resolution are you looking for in print? If you export your raster at 300 dpi, and enable lossless PNG compression, shouldn't it suffice for most print purposes?

It still has limited resolution and a much higher storage footprint. Plotting charts is the vector graphics use case par excellence. Having svg support is a no brainer.

Of course you're right that we do need to support SVG and vector formats, but it's also not entirely true that "vector >> raster" in all cases.

Raster does have limited resolution, but so does your screen or most output devices (yes, even scientific plotters).

It's also not necessarily true that it has a higher storage footprint; it depends on the complexity and number of glyphs, the fonts you need to embed for the LaTeX formulae, etc. etc. In large-data cases, raster can be a much more viable visualization transfer medium.

Re: Bokeh – a Python interactive visualization library

#39
post #8

Strange name, it refers to the way a camera lens blurs out-of-focus objects (especially highlights) into a disc shape [1]. I was expecting an image processing library. Bokeh is widely discussed by photography equipment aficionados as one of the main distinguishing traits of different lens designs besides sharpness, distortion, etc. edit: maybe it is an allusion to bubble plots? [1] https://www.google.com/search?q=bok…

In the "Technical Vision" part of our docs, I speak to this a little bit: http://bokehplots.com/pages/technical-vision.html

A very large part of the vision is that we want to support accurate and useful visualization on large datasets. This is now encapsulated in the Datashader library (although it plays well with Bokeh itself): https://github.com/bokeh/datashader

If you are interested in this, we just did a webinar this week on Datashader, and demonstrate how to easily visualize billions of points through the browser, in a few seconds, on a single machine: https://continuum-analytics.wistia.com/medias/8zu9idwoym?mkt...

Re: Bokeh – a Python interactive visualization library

#40
Ruby is so behind in this... :/ The closest thing I could find, which is only just a proposed enhancement in a github project, is considering adding ploty.js to Flammarion (a new Ruby GUI toolkit using the browser as working window), or maybe Ruby Processing to some extent?
Post reply on HN