High-Level Interface to Create Figures/Animations with Matplotlib
This module provides a high-level interface to create figures/animations (currently only in matplotlib). It was designed to be used within PHOEBE but written in a way that it can be used as a standalone package.
autofig aims to provide the following:
- a unified calling structure to matplotlib's plot, scatter, errorbar, LineCollection, and PolyCollection in both 2D and 3D projections. So if you decide you want to add errorbars or colorscaling to an existing plot call, you don't need to change the entire calling structure anymore.
- basic "3D" support within 2D figures (by providing the z-coordinate, the z-orders will automatically be set)
- a high-level wrapper to animate an existing plot over some independent-variable (i.e. time), with effects including highlight and uncover.
- intelligent options for axes limits within animations.
- intelligent defaults for subplot creation based on conflicts in units/labels.
In general, autofig attempts to provide smart defaults with a high-level interface while still providing full customization with access to the underlying matplotlib objects.
autofig requires the following dependencies:
autofig is available via pip:
pip install autofig
Alternatively, to install from source, use the standard python setup.py commands.
To install globally:
python setup.py build sudo python setup.py install
Or to install locally:
python setup.py build python setup.py install --user
Now from within python we can import the
- size modes
- subplot/axes positioning
- saving & loading
- accessing matplotlib objects and calling custom commands
Browse the gallery to find an example script for various types of figures.
See the API documentation for full details on each type of available distribution.
How it works
autofig builds up objects for the Figure, Axes, and individual plotting Calls (currently Plot or Mesh). These then handle high-level functionality such as axes limits and subplot placement.
Contributions are welcome! Feel free to file an issue or fork and create a pull-request.