Other Visualization Packages in Python
======================================
There are a number of packages which interact with matplotlib, or work
on their own, to extend python’s plotting abilities.
We’ll use the Roessler chaos model to generate data for plotting in this
notebook:
.. code:: ipython3
%pylab inline
import pysd
model = pysd.read_vensim('../../models/Roessler_Chaos/roessler_chaos.mdl')
res = model.run()
.. parsed-literal::
Populating the interactive namespace from numpy and matplotlib
Seaborn
~~~~~~~
`Seaborn `__ is a
package which aims to make plots more stylish. To use it, we simply have
to import it into the python environment and continue plotting as with
``matplotlib``. ``Seaborn`` provides a host of new functions and
customizations that are illustrated
`here `__.
.. code:: ipython3
import seaborn
plt.plot(res['x'], res['y']);
.. image:: other_visualization_libraries_files/other_visualization_libraries_4_0.png
MPLD3
~~~~~
`MPLD3 `__ translates matplotlib plotting
syntax into a `d3 `__-rendered interactive javascript
object.
Note that in the figure below, zoom and pan tools allow you to interact
with the image.
Syntax here is very similar to before, with the addition of a call to
the ``display`` function. For further examples see the `mpld3
gallery `__.
.. code:: ipython3
import mpld3
plt.plot(res['x'], res['y']);
mpld3.display()
.. raw:: html