ó
—W[c           @   s  d  Z  d d l m Z d d l Z d d l Z d d l m Z m Z e e j	 ƒ d k Z
 e e j	 ƒ d k Z d d	 d
 d d d d d g Z d d d d d d d d d d d d d d d d d  d! g Z e rù e j d" d# d$ d% d& d' d( d) d* g	 ƒ n  d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< d= g Z d> d? d@ dA d e d dB „ Z dC „  Z dD „  Z d d dE „ Z d d dF „ Z d d d dG „ Z d d d dH „ Z dI e f dJ „  ƒ  YZ dK e f dL „  ƒ  YZ dM e f dN „  ƒ  YZ d d e dO „ Z d S(P   sG   Control plot style and scaling using the matplotlib rcParams interface.iÿÿÿÿ(   t   LooseVersionNi   (   t   palettest   _orig_rc_paramss   1.5.0s   2.0t   sett   reset_defaultst
   reset_origt
   axes_stylet	   set_stylet   plotting_contextt   set_contextt   set_palettes   axes.facecolors   axes.edgecolors	   axes.grids   axes.axisbelows   axes.labelcolors   figure.facecolors
   grid.colors   grid.linestyles
   text.colors   xtick.colors   ytick.colors   xtick.directions   ytick.directions   lines.solid_capstyles   patch.edgecolors
   image.cmaps   font.familys   font.sans-serifs   patch.force_edgecolors   xtick.bottoms	   xtick.tops
   ytick.lefts   ytick.rights   axes.spines.lefts   axes.spines.bottoms   axes.spines.rights   axes.spines.tops	   font.sizes   axes.labelsizes   axes.titlesizes   xtick.labelsizes   ytick.labelsizes   legend.fontsizes   axes.linewidths   grid.linewidths   lines.linewidths   lines.markersizes   patch.linewidths   xtick.major.widths   ytick.major.widths   xtick.minor.widths   ytick.minor.widths   xtick.major.sizes   ytick.major.sizes   xtick.minor.sizes   ytick.minor.sizet   notebookt   darkgridt   deeps
   sans-serifc         C   sW   t  |  | ƒ t | d i | d 6ƒt | d | ƒ| d k	 rS t j j | ƒ n  d S(   sš  Set aesthetic parameters in one step.

    Each set of parameters can be set directly or temporarily, see the
    referenced functions below for more information.

    Parameters
    ----------
    context : string or dict
        Plotting context parameters, see :func:`plotting_context`
    style : string or dict
        Axes style parameters, see :func:`axes_style`
    palette : string or sequence
        Color palette, see :func:`color_palette`
    font : string
        Font family, see matplotlib font manager.
    font_scale : float, optional
        Separate scaling factor to independently scale the size of the
        font elements.
    color_codes : bool
        If ``True`` and ``palette`` is a seaborn palette, remap the shorthand
        color codes (e.g. "b", "g", "r", etc.) to the colors from this palette.
    rc : dict or None
        Dictionary of rc parameter mappings to override the above.

    t   rcs   font.familyt   color_codesN(   R	   R   R
   t   Nonet   mplt   rcParamst   update(   t   contextt   stylet   palettet   fontt
   font_scaleR   R   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   \   s
    c           C   s   t  j j t  j ƒ d S(   s*   Restore all RC params to default settings.N(   R   R   R   t   rcParamsDefault(    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   ~   s    c           C   s   t  j j t ƒ d S(   s@   Restore all RC params to original settings (respects custom rc).N(   R   R   R   R   (    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   ƒ   s    c         C   sÍ  |  d4 k r d „  t Dƒ } nVt |  t ƒ r7 |  } n>d d d d d g } |  | k rt t d d j | ƒ ƒ ‚ n  d	 } d
 } i d d 6| d 6d d 6d d 6| d 6| d 6t d 6d d 6| d 6d g d 6d d d d d g d 6d d 6d d  6t d! 6d" d# 6t d$ 6t d% 6} d& |  k r2| j i t d' 6ƒ n | j i t d' 6ƒ |  j	 d ƒ r–| j i d( d) 6d d* 6d d+ 6t d, 6t d- 6t d. 6t d/ 6ƒ nš |  d k rã| j i d d) 6| d* 6| d+ 6t d, 6t d- 6t d. 6t d/ 6ƒ nM |  d5 k r0| j i d d) 6| d* 6| d+ 6t d, 6t d- 6t d. 6t d/ 6ƒ n  |  d k rZ| j i t d0 6t d1 6ƒ n | j i t d0 6t d1 6ƒ d2 „  | j
 ƒ  Dƒ } | d4 k	 r½d3 „  | j
 ƒ  Dƒ } | j | ƒ n  t | ƒ } | S(6   sÔ  Return a parameter dict for the aesthetic style of the plots.

    This affects things like the color of the axes, whether a grid is
    enabled by default, and other aesthetic elements.

    This function returns an object that can be used in a ``with`` statement
    to temporarily change the style parameters.

    Parameters
    ----------
    style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks}
        A dictionary of parameters or the name of a preconfigured set.
    rc : dict, optional
        Parameter mappings to override the values in the preset seaborn
        style dictionaries. This only updates parameters that are
        considered part of the style definition.

    Examples
    --------
    >>> st = axes_style("whitegrid")

    >>> set_style("ticks", {"xtick.major.size": 8, "ytick.major.size": 8})

    >>> import matplotlib.pyplot as plt
    >>> with axes_style("white"):
    ...     f, ax = plt.subplots()
    ...     ax.plot(x, y)               # doctest: +SKIP

    See Also
    --------
    set_style : set the matplotlib parameters for a seaborn theme
    plotting_context : return a parameter dict to to scale plot elements
    color_palette : define the color palette for a plot

    c         S   s    i  |  ] } t  j | | “ q S(    (   R   R   (   t   .0t   k(    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>­   s   	 t   whitet   darkt	   whitegridR   t   tickss   style must be one of %ss   , s   .15s   .8s   figure.facecolors   axes.labelcolort   outs   xtick.directions   ytick.directions   xtick.colors   ytick.colors   axes.axisbelowt   -s   grid.linestyles
   text.colors
   sans-serifs   font.familyt   Arials   DejaVu Sanss   Liberation Sanss   Bitstream Vera Sanss   font.sans-serift   rounds   lines.solid_capstylet   ws   patch.edgecolors   patch.force_edgecolort   rockets
   image.cmaps	   xtick.tops   ytick.rightt   grids	   axes.grids   #EAEAF2s   axes.facecolors   axes.edgecolors
   grid.colors   axes.spines.lefts   axes.spines.bottoms   axes.spines.rights   axes.spines.tops   xtick.bottoms
   ytick.leftc         S   s+   i  |  ]! \ } } | t  k r | | “ q S(    (   t   _style_keys(   R   R   t   v(    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>  s   	 c         S   s+   i  |  ]! \ } } | t  k r | | “ q S(    (   R'   (   R   R   R(   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>"  s   	 N(   R   R   (   R   R'   t
   isinstancet   dictt
   ValueErrort   joint   Truet   FalseR   t
   startswitht   itemst
   _AxesStyle(   R   R   t
   style_dictt   stylest	   dark_grayt
   light_grayt   style_object(    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   ˆ   s’    $	
	
							c         C   s#   t  |  | ƒ } t j j | ƒ d S(   s½  Set the aesthetic style of the plots.

    This affects things like the color of the axes, whether a grid is
    enabled by default, and other aesthetic elements.

    Parameters
    ----------
    style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks}
        A dictionary of parameters or the name of a preconfigured set.
    rc : dict, optional
        Parameter mappings to override the values in the preset seaborn
        style dictionaries. This only updates parameters that are
        considered part of the style definition.

    Examples
    --------
    >>> set_style("whitegrid")

    >>> set_style("ticks", {"xtick.major.size": 8, "ytick.major.size": 8})

    See Also
    --------
    axes_style : return a dict of parameters or use in a ``with`` statement
                 to temporarily set the style.
    set_context : set parameters to scale plot elements
    set_palette : set the default color palette for figures

    N(   R   R   R   R   (   R   R   R6   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   +  s    c      	      s½  |  d' k r d „  t Dƒ ‰  n\t |  t ƒ r7 |  ‰  nDd d d d g } |  | k rq t d d j | ƒ ƒ ‚ n  i d d	 6d d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d d! 6} t d d" d d d d d d# ƒ |  ‰ ‡ f d$ †  | j ƒ  Dƒ ‰  d
 d d d d d	 g } ‡  ‡ f d% †  | Dƒ } ˆ  j | ƒ | d' k	 r­d& „  | j ƒ  Dƒ } ˆ  j | ƒ n  t ˆ  ƒ } | S((   sB  Return a parameter dict to scale elements of the figure.

    This affects things like the size of the labels, lines, and other
    elements of the plot, but not the overall style. The base context
    is "notebook", and the other contexts are "paper", "talk", and "poster",
    which are version of the notebook parameters scaled by .8, 1.3, and 1.6,
    respectively.

    This function returns an object that can be used in a ``with`` statement
    to temporarily change the context parameters.

    Parameters
    ----------
    context : dict, None, or one of {paper, notebook, talk, poster}
        A dictionary of parameters or the name of a preconfigured set.
    font_scale : float, optional
        Separate scaling factor to independently scale the size of the
        font elements.
    rc : dict, optional
        Parameter mappings to override the values in the preset seaborn
        context dictionaries. This only updates parameters that are
        considered part of the context definition.

    Examples
    --------
    >>> c = plotting_context("poster")

    >>> c = plotting_context("notebook", font_scale=1.5)

    >>> c = plotting_context("talk", rc={"lines.linewidth": 2})

    >>> import matplotlib.pyplot as plt
    >>> with plotting_context("paper"):
    ...     f, ax = plt.subplots()
    ...     ax.plot(x, y)                 # doctest: +SKIP

    See Also
    --------
    set_context : set the matplotlib parameters to scale plot elements
    axes_style : return a dict of parameters defining a figure style
    color_palette : define the color palette for a plot

    c         S   s    i  |  ] } t  j | | “ q S(    (   R   R   (   R   R   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>y  s   	 t   paperR   t   talkt   posters   context must be in %ss   , i   s	   font.sizes   axes.labelsizes   axes.titlesizei   s   xtick.labelsizes   ytick.labelsizes   legend.fontsizeg      ô?s   axes.linewidthi   s   grid.linewidthg      ø?s   lines.linewidthi   s   lines.markersizes   patch.linewidths   xtick.major.widths   ytick.major.widths   xtick.minor.widths   ytick.minor.widths   xtick.major.sizes   ytick.major.sizei   s   xtick.minor.sizes   ytick.minor.sizegš™™™™™é?i   c            s#   i  |  ] \ } } | ˆ  | “ q S(    (    (   R   R   R(   (   t   scaling(    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>¢  s   	 c            s!   i  |  ] } ˆ  | ˆ | “ q S(    (    (   R   R   (   t   context_dictR   (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>§  s   	 c         S   s+   i  |  ]! \ } } | t  k r | | “ q S(    (   t   _context_keys(   R   R   R(   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>¬  s   	 N(	   R   R<   R)   R*   R+   R,   R0   R   t   _PlottingContext(   R   R   R   t   contextst   base_contextt	   font_keyst	   font_dictt   context_object(    (   R;   R   R:   s,   lib/python2.7/site-packages/seaborn/rcmod.pyR   L  sL    ,	
%	c         C   s&   t  |  | | ƒ } t j j | ƒ d S(   s&  Set the plotting context parameters.

    This affects things like the size of the labels, lines, and other
    elements of the plot, but not the overall style. The base context
    is "notebook", and the other contexts are "paper", "talk", and "poster",
    which are version of the notebook parameters scaled by .8, 1.3, and 1.6,
    respectively.

    Parameters
    ----------
    context : dict, None, or one of {paper, notebook, talk, poster}
        A dictionary of parameters or the name of a preconfigured set.
    font_scale : float, optional
        Separate scaling factor to independently scale the size of the
        font elements.
    rc : dict, optional
        Parameter mappings to override the values in the preset seaborn
        context dictionaries. This only updates parameters that are
        considered part of the context definition.

    Examples
    --------
    >>> set_context("paper")

    >>> set_context("talk", font_scale=1.4)

    >>> set_context("talk", rc={"lines.linewidth": 2})

    See Also
    --------
    plotting_context : return a dictionary of rc parameters, or use in
                       a ``with`` statement to temporarily set the context.
    set_style : set the default parameters for figure style
    set_palette : set the default color palette for figures

    N(   R   R   R   R   (   R   R   R   RB   (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR	   µ  s    %t   _RCAestheticsc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c            s6   t  j ‰  ‡  f d †  |  j Dƒ |  _ |  j |  ƒ d  S(   Nc            s   i  |  ] } ˆ  | | “ q S(    (    (   R   R   (   R   (    s,   lib/python2.7/site-packages/seaborn/rcmod.pys
   <dictcomp>á  s   	 (   R   R   t   _keyst   _origt   _set(   t   self(    (   R   s,   lib/python2.7/site-packages/seaborn/rcmod.pyt	   __enter__ß  s    	c         C   s   |  j  |  j ƒ d  S(   N(   RF   RE   (   RG   t   exc_typet	   exc_valuet   exc_tb(    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyt   __exit__ä  s    c            s%   t  j ˆ  ƒ ‡  ‡ f d †  ƒ } | S(   Nc             s   ˆ  ˆ  |  | Ž  SWd  QXd  S(   N(    (   t   argst   kwargs(   t   funcRG   (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyt   wrapperè  s    (   t	   functoolst   wraps(   RG   RO   RP   (    (   RO   RG   s,   lib/python2.7/site-packages/seaborn/rcmod.pyt   __call__ç  s    !(   t   __name__t
   __module__RH   RL   RS   (    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyRC   Þ  s   		R1   c           B   s    e  Z d  Z e Z e e ƒ Z RS(   s1   Light wrapper on a dict to set style temporarily.(   RT   RU   t   __doc__R'   RD   t   staticmethodR   RF   (    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR1   ï  s   R=   c           B   s    e  Z d  Z e Z e e ƒ Z RS(   s3   Light wrapper on a dict to set context temporarily.(   RT   RU   RV   R<   RD   RW   R	   RF   (    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR=   õ  s   c         C   s    t  j |  | | ƒ } t rJ d d l m } | d | ƒ } | t j d <n t | ƒ t j d <| d t j d <| rœ y t  j |  ƒ Wqœ t k
 r˜ qœ Xn  d S(	   s1  Set the matplotlib color cycle using a seaborn palette.

    Parameters
    ----------
    palette : seaborn color paltte | matplotlib colormap | hls | husl
        Palette definition. Should be something that :func:`color_palette`
        can process.
    n_colors : int
        Number of colors in the cycle. The default number of colors will depend
        on the format of ``palette``, see the :func:`color_palette`
        documentation for more information.
    desat : float
        Proportion to desaturate each color by.
    color_codes : bool
        If ``True`` and ``palette`` is a seaborn palette, remap the shorthand
        color codes (e.g. "b", "g", "r", etc.) to the colors from this palette.

    Examples
    --------
    >>> set_palette("Reds")

    >>> set_palette("Set1", 8, .75)

    See Also
    --------
    color_palette : build a color palette or set the color cycle temporarily
                    in a ``with`` statement.
    set_context : set parameters to scale plot elements
    set_style : set the default parameters for figure style

    iÿÿÿÿ(   t   cyclert   colors   axes.prop_cycles   axes.color_cyclei    s   patch.facecolorN(	   R   t   color_palettet
   mpl_ge_150RX   R   R   t   listt   set_color_codesR+   (   R   t   n_colorst   desatR   t   colorsRX   t   cyl(    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyR
   û  s     (   RV   t   distutils.versionR    RQ   t
   matplotlibR   t    R   R   t   __version__R[   t   mpl_ge_2t   __all__R'   t   extendR<   R-   R   R   R   R   R   R   R   R	   R*   RC   R1   R=   R.   R
   (    (    (    s,   lib/python2.7/site-packages/seaborn/rcmod.pyt   <module>   sŠ   					!		£!i)