matplotlib in other frameworks

In general, third-party libraries that depend on or provide support to the process of interfacing with matplotlib do so mostly through the scripting layer. Here is a quick summary of a few libraries that use matplotlib:

  • Seaborn: This library uses all the matplotlib.pyplot functions.
  • NetworkX: This library essentially uses all the matplotlib.pyplot functions, with the only exception being some backend and artist layer interfacing that is used to generate the project's gallery (which is another good example of the programmatic approach for batched jobs).
  • Pandas: This library mostly uses matplotlib.pyplot, but it sometimes also uses the deprecated pylab interface. It also has some custom transforms and tickers in its time series converter code.
  • scikit-learn: This library mostly uses matplotlib.pyplot along with some custom use of the font manager and color mapping. It also takes advantage of the collections, finance, and mpl_toolkits modules, among others. Additionally, this library performs some custom backend tweaking.

This is just a partial sampling of the respectable scientific computing libraries available that use matplotlib. The overwhelming impression that one is left with is twofold:

  • The matplotlib module has been put to some very impressive use.
  • The pyplot API in matplotlib is extensively used by every project in the community. Respect.

An important note on IPython

While discussing matplotlib in other frameworks, I would be remiss if the following was not mentioned. As of April 2014, IPython no longer supports starting with the –pylab flag. This is a big change, and many tutorials, books, and open source documents need to be updated with new best practices to start up IPython along with matplotlib. The preferred way of using matplotlib in the IPython Notebooks is demonstrated in the following code:

In [1]: %matplotlib inline
        import numpy as np
        import matplotlib.pyplot as plt

This change in IPython came as a result of the project's expansive growth in non-Python communities. With the ongoing development in the support of Julia and Haskell, their architecture is becoming language-agnostic. In fact, the project now has a new, more inclusive name (with a nice nod to its Python roots)—Jupyter.

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

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