Metadata-Version: 1.1
Name: publib
Version: 0.1.6
Summary: Produce publication-level quality images on top of Matplotlib
Home-page: https://github.com/rainwear/publib
Author: Erwan Pannier
Author-email: erwan.pannier@gmail.com
License: CeCILL-2.1
Description: Publib

        ======

        

        *Erwan Pannier - EM2C Laboratory, CentraleSupélec / CNRS UPR 288*

        

        Description

        -----------

        

        Produce publication-level quality images on top of Matplotlib, with a

        simple call to couple functions at the start and end of your script.

        

        `Project GitHub page <https://github.com/rainwear/publib>`__

        

        For similar librairies, see

        `seaborn <http://stanford.edu/~mwaskom/software/seaborn/>`__, which also

        add neat high-end API to Matplotlib function calls.

        

        Use

        ---

        

        At the beginning of the script, call:

        

        .. code:: python

        

            set_style()

        

        After each new axe is plotted, call:

        

        .. code:: python

        

            fix_style()

        

        Note that importing publib will already load the basic style.

        

        A few more styles ('poster', 'article', etc.) can be selected with the

        function ``set_style()``

        

        Because some matplotlib parameters cannot be changed before the lines

        are plotted, they are called through the function ``fix_style()`` which:

        

        -  changes the minor ticks

        

        -  remove the spines

        

        -  turn the legend draggable by default

        

        Examples

        --------

        

        .. code:: python

        

            import numpy as np

            import matplotlib.pyplot as plt

        

        A default Matplotlib plot:

        

        .. code:: python

        

            x = np.linspace(0,5,250)

            y = np.cos(x)**2+np.random.normal(scale=0.5,size=len(x))

            yav = np.cos(x)**2

            plt.figure()

            ax = plt.subplot()

            ax.plot(x,y,'o',label='normal distribution')

            ax.plot(x,yav,zorder=-1,label='average')

            plt.xlabel(r'$x$')

            plt.ylabel(r'$\cos^2 x$+noise')

            plt.title('matplotlib')

            plt.legend(loc='upper left')

            plt.ylim((-1.5,3.5))

            plt.show()

        

        .. figure:: docs/mpl_default.png

           :alt: https://github.com/rainwear/publib/blob/master/docs/mpl\_default.png

        

           https://github.com/rainwear/publib/blob/master/docs/mpl\_default.png

        

        And now the same code with the two new lines calling the publib

        functions

        

        .. code:: python

        

            from publib import set_style, fix_style

            set_style('article')        # before the first plot

        

            x = np.linspace(0,5,250)

            y = np.cos(x)**2+np.random.normal(scale=0.5,size=len(x))

            yav = np.cos(x)**2

            plt.figure()

            ax = plt.subplot()

            ax.plot(x,y,'o',label='normal distribution')

            ax.plot(x,yav,zorder=-1,label='average')

            plt.xlabel(r'$x$')

            plt.ylabel(r'$\cos^2 x$+noise')

            plt.title('article')

            plt.legend(loc='upper left')

            plt.ylim((-1.5,3.5))

            plt.show()

        

            fix_style('article')  # after the axe has been created

        

            plt.show()

        

        .. figure:: docs/publib_article.png

           :alt: https://github.com/rainwear/publib/blob/master/docs/publib\_article.png

        

           https://github.com/rainwear/publib/blob/master/docs/publib\_article.png

        

        Run the \_test() routine in publib.py for more examples.

        

        Changes

        -------

        

        0.1.6 : improve Readme 0.1.5 : changed those buff\_style functions in

        fix\_style

        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Text Processing
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Operating System :: OS Independent
