py con india 2016

Post on 22-Jan-2018

147 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Interactive Date Plotting With Bokeh

Kaustuv Deolal

Bokeh !! Well what is that ?

Well he would say

Bokeh is a Python interactive visualization library that targets modern web browsers for presentation. Its goal is to provide elegant, concise construction of novel graphics in the style of D3.js, and to extend this capability with high-performance interactivity over very large or streaming datasets. Bokeh can help anyone who would like to quickly and easily create interactive plots, dashboards, and data applications.

In Rancho’s words !

“A pretty amazing plotting library with tons of features”

Bokeh is simply not confined to Python. It has bindings in different languages. These languages output a Json file which serves as an input for BokehJS , which is a JavaScript library

Since this is PyCon we will be talking about Bokeh Python only !!

Output features

File Notebook Server .Here we show only file

Plotting with Bokeh

Charts !!

Basic Charts Code

Charts Continued……

Bokeh can display plots from other python visualization libraries

Plots from Matplotlib, Seaborn, ggplot can be displayed using Bokeh

bokeh.mpl function is used to display plots from these

to_bokeh() uses bokeh to display Matplotlibfigure.

Yes Flask can be integrated with Bokeh

It does make altogether more dynamic

If you have an external web service that you can communicate with to control your data and your app behaviour then you can actually achieve very powerful functionalities

Bokeh has seamless integration with any web framework. Bokeh Flask is an example for that

The primary issue is not whether or not pixels are painted onto the screen via a web page. For instance, one could write some python code which outputs an HTML file that embeds a Matplotlib PNG image along with a carefully-crafted old-school imagemap via the <map> tag.

The key difference is who the libraries are made for.

D3 requires reasonable knowledge of javascript, and also quite a bit of learning of how the D3 visualization engine itself works. Bokeh, on the other hand, targets users who are interested in writing Python or R or other non-Javascript languages, but who still want interactive graphics in the browser.

Matplotlib is too much work for creating decent looking graphs. And is too verbose. Graphs can be made more aesthetic with less line of code

Seaborn is another plotting library , but is again based on matplotlib

Pygal can generate interactive plots but is again not customizable

top related