Interactive visualization packages

A few years ago, there were not many interactive tools besides IPython. In order to understand how you can make any visualization interactive, it makes sense to compare it with an existing tool (such as D3.js). One of the reasons why D3.js is very powerful is that a JavaScript-based plotting framework can make the plots to be presented on the Web. Moreover, it comes with all the event-driven functions that can be configured easily.

There are two visualization libraries called Bokeh and VisPy that are popular among a few that are available today. There is another tool called Wakari. This is mainly used for data analytics with a resemblance to IPython in terms of how you can create a browser-based visualization. The Ashiba project was another tool that was developed by Clayton Davis at Continuum, but since the focus of Continuum shifted to Bokeh and Wakari, there is very little work that has been done on Ashiba in the past few years.

Bokeh

Bokeh is an interactive visual library that is developed in Python and is targeted to work via web browsers. Where does the name Bokeh come from? This is a Japanese word that describes the blurring or the parts of an image that are out of focus. The goal was to develop a library that closely resembles the aesthetics of D3.js; the choice of the name Bokeh seemed to match. Bokeh writes to the HTML5 Canvas library and therefore guarantees to work on browsers that support HTML5. This is useful because you would want to compare the JavaScript-based plots with Python.

We will not elaborate much about this tool. You can read and explore more about this at http://bokeh.pydata.org. However, what is important is to know the dependencies of the Bokeh library. Before installing the Bokeh library, it is required that jsonschema be installed, as follows:

conda install jsonschema

Fetching package metadata: ....
Solving package specifications: .
Package plan for installation in environment /Users/MacBook/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    jsonschema-2.4.0           |           py27_0          51 KB

The following NEW packages will be INSTALLED:

    jsonschema: 2.4.0-py27_0

Proceed ([y]/n)?

The examples of interactive visualization using Bokeh, pandas, SciPy, matplotlib, and ggplot can be found at http://nbviewer.ipython.org/gist/fonnesbeck/ad091b81bffda28fd657.

VisPy

VisPy is a visualization library for 2D or 3D plotting that is interactive and has high performance. You can take advantage of the OpenGL knowledge to create visualization quickly. It also has methods that do not necessarily require a deep understanding of OpenGL. For more information, you can read the documentation at vispy.org.

In order to install the VisPy library, one may attempt the conda install vispy command, but it most likely responds with the binstar search –t conda vispy suggestion. The following code is one of those in the list:

conda install --channel https://conda.binstar.org/asmeurer vispy

With this command, you will obtain the following the response:

Fetching package metadata: ......
Solving package specifications: .
Package plan for installation in environment /Users/MacBook/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    numpy-1.8.2                |           py27_0         2.9 MB
    vispy-0.3.0                |       np18py27_0         679 KB
    ------------------------------------------------------------
                                           Total:         3.6 MB

The following NEW packages will be INSTALLED:

    vispy: 0.3.0-np18py27_0

The following packages will be DOWNGRADED:

    numpy: 1.9.2-py27_0 --> 1.8.2-py27_0    

Proceed ([y]/n)?

There are many examples in the gallery collection of VisPy. One particular example of the display of points that uses the vispy.gloo command and GLSL shading code can be viewed at http://vispy.org/gloo.html?highlight=gloo#module-vispy.gloo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset