Additional Python data visualization tools

Besides matplotlib, there are other powerful data visualization toolkits based on Python. While we cannot dive deeper into these libraries, we would like to at least briefly introduce them in this session.

Bokeh

Bokeh is a project by Peter Wang, Hugo Shi, and others at Continuum Analytics. It aims to provide elegant and engaging visualizations in the style of D3.js. The library can quickly and easily create interactive plots, dashboards, and data applications. Here are a few differences between matplotlib and Bokeh:

  • Bokeh achieves cross-platform ubiquity through IPython's new model of in-browser client-side rendering
  • Bokeh uses a syntax familiar to R and ggplot users, while matplotlib is more familiar to Matlab users
  • Bokeh has a coherent vision to build a ggplot-inspired in-browser interactive visualization tool, while Matplotlib has a coherent vision of focusing on 2D cross-platform graphics.

The basic steps for creating plots with Bokeh are as follows:

  • Prepare some data in a list, series, and Dataframe
  • Tell Bokeh where you want to generate the output
  • Call figure() to create a plot with some overall options, similar to the matplotlib options discussed earlier
  • Add renderers for your data, with visual customizations such as colors, legends, and width
  • Ask Bokeh to show() or save() the results

MayaVi

MayaVi is a library for interactive scientific data visualization and 3D plotting, built on top of the award-winning visualization toolkit (VTK), which is a traits-based wrapper for the open-source visualization library. It offers the following:

  • The possibility to interact with the data and object in the visualization through dialogs.
  • An interface in Python for scripting. MayaVi can work with Numpy and scipy for 3D plotting out of the box and can be used within IPython notebooks, which is similar to matplotlib.
  • An abstraction over VTK that offers a simpler programming model.

Let's view an illustration made entirely using MayaVi based on VTK examples and their provided data:

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

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