
Bokeh – a Python interactive visualization library - sonabinu
http://bokeh.pydata.org/en/latest/
======
herrkanin
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.

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

~~~
noobermin
I severely dislike Gnuplot, but then again, I am wedded to Python. I'm not
sure how versatile it is, at least from the slightly acquainted position I am.

~~~
bigreddot
FYI it's really dead simple to write new "bokeh" command line tools as Bokeh
apps now. We already have several ("bokeh html" and "bokeh json") but we are
definitely interested in make a gnuplot-like bokeh command line tool that you
can just point at a CSV or log file and get a visualization right out. E.g.
something like "bokeh graph foo.log -x time -y connections --tail" would
create an automatically updating visualization of a growing log file. Or if
anyone is interested in this functionality and wants to help speed along the
development, please let us know!

------
jbritton
"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?

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

~~~
birdsarah
I forgot the really important difference between bokeh and highcharts - you
can throw 100k points at it and have it be fully interactive without your
browser blowing up!

~~~
mianos
HiCharts has dynamically loadable data. I have a database that has 120M
points. I just keep some pre aggregated data to populate the wide periods. As
you zoom it it selects smaller aggregation sets. (Think; 1 month for 10 years,
2 weeks for 1 year, etc). If you have the data you only need about 20 lines of
JS so support this with json. That said, bokeh requires little to no
javascript and that's a huge advantage if you need to get multiple
visualizations. It does, pretty much stock, what you can do with HiCharts
without needing as much full-stack expertise.

------
codelion
Great library, specially useful for doing streaming visualizations. I gave a
talk last year at PyData Singapore about it, slides are available here -
[http://asankhaya.github.io/professional.html#PyDataSG](http://asankhaya.github.io/professional.html#PyDataSG)

~~~
canavandl
That's super cool.

------
blt
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=bokeh&tbm=isch](https://www.google.com/search?q=bokeh&tbm=isch)

~~~
birdsarah
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.....

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

~~~
andrepd
Which brings in focus elements into sharper attention.

~~~
skeletonjelly
And a photo that is entirely bokeh?

[http://i.imgur.com/siLB9C3.jpg](http://i.imgur.com/siLB9C3.jpg)

------
eruditely
I've been playing around with this library and really like it. Python really
is that much easier to use than R isn't it? Too bad most on the libraries are
still in R. It's strange that there isn't a language written on top of R that
is less troublesome to use or learn.

~~~
Lofkin
Call the libraries with Rpy2, or build models using a DAG of functions and
distributions with pymc 3

~~~
eruditely
Thanks i'll check that out.

------
MrBra
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?

~~~
pwang
Actually, we'd LOVE to get a bokeh.rb project going! Most of the power of
Bokeh is in the BokehJS runtime, and in our M-VM-V-C architecture for
visualization. The Python code is just generating a JSON representation of the
plot, but it's relatively straightforward to do that from any language. You
can see front-end implementations in other languages:

* R: [https://github.com/bokeh/rbokeh](https://github.com/bokeh/rbokeh) * Scala: [https://github.com/bokeh/bokeh-scala](https://github.com/bokeh/bokeh-scala) * Julia: [https://github.com/bokeh/Bokeh.jl](https://github.com/bokeh/Bokeh.jl)

The Facebook data science folks even implemented a small Bokeh wrapper in Lua,
as part of their iTorch package:
[https://github.com/facebook/iTorch/blob/master/Plot.lua](https://github.com/facebook/iTorch/blob/master/Plot.lua)

So, you can see that you can get started with a basic wrapper, and then build
up from there. The Lua wrapper is only ~850 lines. If you want to pop over to
the mailing list or on our Github, we'd love to help you out.

------
navbaker
Any chance of getting access to the old tutorials that consisted of scripts
with the boilerplate written, but missing the key functionality? I was really
enjoying working through them and digging into the docs, then all of a sudden
they were taken offline and I was directed to the notebooks.

------
Niksko
Bokeh is cool, but I've found that it's method for customizing appearance of
graphs is a little unintuitive and clunky.

For example, have a look at this cursory analysis of my Reddit comments that I
did late last year. Getting the graphs to look nice felt like pulling teeth at
the time.

[http://nbviewer.jupyter.org/github/Niksko/redditCommentData/...](http://nbviewer.jupyter.org/github/Niksko/redditCommentData/blob/master/CommentAnalysis.ipynb)

That being said, I'm reasonably happy with the results. And that pannable,
zoomable line graph is pretty fancy and is easy to set up.

------
bootload
_" To use the Bokeh server with python 2.7, you also need to install Futures
package."_

Does this statement mean it supports Py3 and if you want to use it with 2.7
you need Futures? Or is it only Py2.X? [0]

[0]
[http://bokeh.pydata.org/en/latest/docs/installation.html](http://bokeh.pydata.org/en/latest/docs/installation.html)

~~~
travisoliphant
Bokeh can be used with both Python 2.7 and Python 3. Additional dependencies
are needed to work with Python 2.7. In fact, the "write call-back functions in
Python" capability uses a Python to JS compiler called Flexx --
[http://flexx.readthedocs.org/en/latest/flexjs](http://flexx.readthedocs.org/en/latest/flexjs).
Flexx is currently Python 3 only (though 2.7 support is coming for it).

~~~
bootload
thx @travisoliphant the requirements are not clear in the docs. This
explanation makes more sense.

~~~
fpliger
Thanks for the feedback. We keep a continuous and frequent effort to make
documentation more efficient and straightforward .. Building clear is a
constant/endless effort and feedback is very important.

To clarify, Futures is required for bokeh server as an extra dependency on
Python 2.7 since it's not a battery included like for Python > 3.2.. if you
conda install Bokeh it should be installed already for you. You can find more
info about the bokeh server features here:
[http://bokeh.pydata.org/en/latest/docs/user_guide/server.htm...](http://bokeh.pydata.org/en/latest/docs/user_guide/server.html)
and here:
[http://bokeh.pydata.org/en/latest/docs/user_guide/cli.html#m...](http://bokeh.pydata.org/en/latest/docs/user_guide/cli.html#module-
bokeh.command.subcommands.serve)

Flexx, on other hand, is not required by bokeh server itself but instead to
define python functions to handle interactivity that runs on the browser (no
need of bokeh server). Flexx is used to convert python to JS. You can find
more info here:
[http://bokeh.pydata.org/en/latest/docs/user_guide/interactio...](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html#customjs-
with-a-python-function)

~~~
bootload
thx @fpilger, fantastic to see another Py3 ready application. It's clear now.
One way to avoid this is either give a install write up an installation guide
[0] that explicitly mentions the python version and dependencies.

This is one of the first questions I ask, "is this code Python3 ready?", so I
look at the install requirements first. Maybe I'm an edge case. A short cut
might be just to say in big words, Python3 ready.

[0] For example this PIL fork, Pillow (python3)
[https://pillow.readthedocs.org/en/latest/installation.html](https://pillow.readthedocs.org/en/latest/installation.html)

~~~
SiVal
If wanting to know up front if this is designed for the future or the past is
an edge case, it's a pretty crowded edge. Python 3 was released eight years
ago, and I will ALWAYS choose a competing technology (if it means a language
other than Python, that's fine with me) before I'll let Python 2 play any role
in a new project I architect.

The first thing I looked for on the Bokeh website was some sort of clear
statement on the front page about it being Python 3. I don't have an immediate
need for it, but if it's Python 3, I'll keep it in mind. If it's just that
euphemistic "Python", it may as well be Cobol for all I'd care.

I thought I'd skim over these comments just in case someone asked the obvious
question, and someone did. (Thank you.) And, yes, it is apparently Python 3
enough that we wouldn't need to use any Python 2 if we adopted it.

Very nice. Now I wish I DID need it, but maybe I'll do a side project of my
own with it, just for fun. I'll be keeping it in mind in any case. I'll bet
"Python 3" is mentioned somewhere on the site, but I didn't spot it right
away. It might be worth making it a bit more prominent, since it is an
important feature for those designing for the future.

~~~
bootload
_" If wanting to know up front if this is designed for the future or the past
is an edge case, it's a pretty crowded edge. Python 3 was released eight years
ago"_

good point: a quick search reveals that Py2.x is still in a lot of legacy code
(dependencies -- the big one), so I always check first:

\- [https://python3wos.appspot.com/](https://python3wos.appspot.com/)

\- [http://stackoverflow.com/questions/30751668/python-2-vs-
pyth...](http://stackoverflow.com/questions/30751668/python-2-vs-
python-3-2015-usage)

\- [http://hiltmon.com/blog/2014/01/04/python-its-a-
trap/](http://hiltmon.com/blog/2014/01/04/python-its-a-trap/)

\- [https://blog.newrelic.com/2014/01/21/python-3-adoption-
web-a...](https://blog.newrelic.com/2014/01/21/python-3-adoption-web-apps/)

\- [http://www.randalolson.com/2015/01/30/python-usage-
survey-20...](http://www.randalolson.com/2015/01/30/python-usage-survey-2014/)

