
W[c        :   @   s  d  d l  m Z d  d l m Z d  d l Z d  d l Z d  d l m Z d  d l	 Z
 d  d l Z d  d l m Z d  d l j Z d  d l j Z d  d l Z d d l m Z d d l m Z d d	 l m Z d d
 l m Z m Z m Z d d l m  Z  d d l! m" Z" m# Z# m$ Z$ m% Z% d d l& m' Z' m( Z( d d d d d d d d d d d g Z) d e* f d     YZ+ d e+ f d     YZ, d e+ f d     YZ- d e+ f d      YZ. d! e. f d"     YZ/ d# e. f d$     YZ0 d% e+ f d&     YZ1 d' e1 f d(     YZ2 d) e1 f d*     YZ3 d+ e+ f d,     YZ4 e5 d- e d.  d/ e d0  d1 e d2  d3 e d4  d5 e d6  d7 e d8  d9 e d:  d; e d<  d= e d>  d? e d@  dA e dB  dC e dD  dE e dF  dG e dH  dI e dJ  dK e dL  dM e dN  dO e dP  dQ e dR  d e dS  d e dT  d e dU  d e dV  d e dW  d e dX  d e dY  d e dZ  d e d[   Z6 e6 j7 e(  e8 e8 e8 e8 e8 e8 e8 e8 e8 d\ d] e9 d^ e8 d_ e: e8 d`  Z; e da  j< e6   e; _= e8 e8 e8 e8 e8 e8 db dc dd e9 de d] df e: e9 e8 e8 e8 e8 d\ e8 dg  Z> e dh  j< e6   e> _= di   Z? e8 e8 e8 e8 e8 e8 e8 e8 e8 d\ d] e9 dj e8 dk e8 e8 dl  Z@ e dm  j< e6   e@ _= e8 e8 e8 e8 e8 e8 e9 e: e8 e8 e8 d^ dn do e8 dp  ZA e dq  j< e6   eA _= e8 e8 e8 e8 e8 e8 e: e8 e8 e8 d^ dn do e8 dr  ZB e ds  j< e6   eB _= e8 e8 e8 e8 e8 e8 e jC dt du e8 e8 e8 e8 d\ dv e8 e8 e9 e8 dw  ZD e dx  j< e6   eD _= e8 e8 e8 e8 e8 e8 e jC dt du e8 dy dz e: e9 d e8 e8 e8 e8 e8 e8 d{  ZE e d|  j< e6   eE _= e8 e8 e8 e8 e8 e8 e8 e8 e8 d\ e9 e8 d}  ZF e d~  j< e6   eF _= d   ZG e8 e8 e8 e8 e8 e8 e8 e jC dt du e8 e8 e8 e8 e8 d d^ d e8 e8 e8 e9 e9 e9 e9 e: e8 d  ZH e d  j< e6   eH _= d S(   i(   t   division(   t   dedentN(   t   stats(   t   PatchCollectioni   (   t   string_types(   t   range(   t   utils(   t   iqrt   categorical_ordert	   remove_na(   t	   bootstrap(   t   color_palettet   husl_palettet   light_palettet   dark_palette(   t	   FacetGridt   _facet_docst   catplott
   factorplott	   stripplott	   swarmplott   boxplott
   violinplott	   boxenplott   lvplott	   pointplott   barplott	   countplott   _CategoricalPlotterc        	   B   s   e  Z d  Z d Z d
 d
 d
 d
 d
 d
 d
 d
 d  Z d   Z d   Z d
 d  Z e	 d    Z
 e	 d    Z d   Z d	   Z RS(   g?t   lightc	         C   sZ  | d k r| d k r| d k	 r9 d }	 t |	   n  d }
 d } d } d } d } d } t | t j  r'| d k r g  } xJ | D]? } y% | | j t j  | j |  Wq t k
 r q Xq Wn  | | } | } | j	 j
 } | j   } g  | D]! \ } } t j | t j  ^ q } n| d k	 rHd }	 t |	   n  t | d  r/t | j  d k rt j | d  r| g } q,t |  } qlt | j  d k r| j \ } } | d k s| d k r| j   g } q,g  t |  D] } | d d  | f ^ q} qld }	 t |	   n= | d k rGg  g } n% t j | d  rf| g } n | } g  | D] } t j | t j  ^ qs} t t t |    } t |  j d	  rd	 n d
 } n5| d k	 r'| j | |  } | j | |  } | j | |  } | j | |  } n  xG | | | | g D]3 } t | t  r:d j |  } t |   q:q:W|  j | | |  } | d k s| d k r| d k r| n | } t j |  g } t | d  r| j
 } n d } d } d } g  } d }
 d } d } d } n | d
 k r2| | } } n | | } } d } t | d  r`| j
 } n  t | |  } |  j | | |  \ } } | d k rd }
 d } d } n* t | |  } |  j | | |  \ }
 } | d k rd } n |  j | | |  \ } } | |  _ | |  _ | |  _ | |  _ | |  _  |
 |  _! | |  _" | |  _# | |  _$ d S(   s9   Convert input specification into a common representation.s#   Cannot use `hue` without `x` or `y`s-   Input data must be a pandas object to reordert   shapei   i    i   Ns/   Input `data` can have no more than 2 dimensionst   ht   vs   Could not interpret input '{}'t   name(%   t   Nonet
   ValueErrort
   isinstancet   pdt	   DataFramet   astypet   npt   floatt   appendt   columnsR!   t	   iteritemst   asarrayt   hasattrt   lenR   t   isscalart   listt   ravelR   t   strt
   startswitht   getR   t   formatt   infer_orientR   t   _group_longformt   orientt	   plot_datat   group_labelt   value_labelt   group_namest	   plot_huest	   hue_titlet	   hue_namest
   plot_units(   t   selft   xt   yt   huet   dataR9   t   ordert	   hue_ordert   unitst   errorR>   R?   R@   RA   R<   R;   t   colR:   R=   t	   iter_datat   kt   st   nrt   nct   it   dt   inputt   errt   valst   groupst   _(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   establish_variables$   s    
1	2($												c   	      C   s   t  | t j  s$ t j |  } n  | j |  } g  } xZ | D]R } y t j | j |   } Wn  t k
 r t j g   } n X| j	 |  q@ W| j
 } | | f S(   s9   Group a long-form variable by another with correct order.(   R$   R%   t   Seriest   groupbyR(   R-   t	   get_groupt   KeyErrort   arrayR*   R!   (	   RB   RU   t   grouperRG   t   grouped_valst   out_datat   gt   g_valst   label(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR8      s    	c         C   s  |  j  d
 k r! t |  j  } n t |  j   } | d
 k r | d
 k r t j   } | t |  k rx t d |  } qkt | d d } n | d
 k r	|  j  d
 k r | g | } qk|  j d k r t	 | |  } qk|  j d k r t
 | |  } qkt d   nb t | t  r\|  j  d
 k r3|  j } n	 |  j  } g  | D] } | | ^ qC} n  t | |  } | d k  rt | d | } n  t |  }	 g  |	 D] }
 t j |
   d ^ q} t |  d	 } t j j | | | f  } |	 |  _ | |  _ d
 S(   s9   Get a list of colors for the main component of the plots.t   n_colorst   lgffffff?R   t   darks   No default palette specifiedi   t   desatg333333?N(   R@   R"   R/   R:   R   t   get_color_cycleR   R   t   default_paletteR   R   t   RuntimeErrorR$   t   dictR=   t   colorsyst
   rgb_to_hlst   mint   mplt   colorst   rgb2hext   gray(   RB   t   colort   palettet
   saturationRd   t   current_paletteRp   t   levelsRe   t
   rgb_colorst   ct
   light_valst   lumRr   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   establish_colors  s<    	 &	c         C   s   t  |  } d   } d   } d } | j d  r7 d S| j d  rJ d S| d k rZ d S| d k rj d S| |  r | |  r t |   q d Sn2 | |  r | |  r t |   q d Sn d Sd S(   s<   Determine how the plot should be oriented based on the data.c         S   sg   y? y t  j j j |   SWn! t k
 r= t  j j j |   SXWn! t k
 rb t |  j  d k SXd  S(   Nt   categorical(	   R%   t   apit   typest   is_categorical_dtypet   AttributeErrort   coret   commonR3   t   dtype(   RN   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   is_categoricalF  s    c         S   s3   y t  j |  d t  j Wn t k
 r. t SXt S(   NR   (   R(   R-   R)   R#   t   Truet   False(   RN   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   is_not_numericQ  s
    s7   Neither the `x` nor `y` variable appears to be numeric.R    R   N(   R3   R4   R"   R#   (   RB   RC   RD   R9   R   R   t
   no_numeric(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR7   B  s*    		c         C   sg   t  |  j  } |  j rT |  j | } t j d |  j | |  } | | j   8} n t j |  } | S(   s>   A list of center positions for plots when hue nesting is used.i    (   R/   R@   t   dodget   widthR(   t   linspacet   meant   zeros(   RB   t   n_levelst
   each_widtht   offsets(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   hue_offsetso  s    	c         C   s3   |  j  r& |  j t |  j  d } n	 |  j } | S(   sA   A float with the width of plot elements when hue nesting is used.g\(\?(   R   R   R/   R@   (   RB   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   nested_width|  s    		c         C   s   |  j  d k r% |  j |  j } } n |  j |  j } } | d
 k	 rT | j |  n  | d
 k	 rp | j |  n  |  j  d k r | j t j t	 |  j
    | j |  j  n/ | j t j t	 |  j
    | j |  j  |  j  d k r%| j j t  | j d t	 |  j
  d d d
 n3 | j j t  | j d t	 |  j
  d d d
 |  j d
 k	 r| j d d  } |  j d
 k	 r| j |  j  y t j d d } Wn t k
 rt j d } n Xt j j d	 |  } | j j j  |  qn  d
 S(   s)   Add descriptive labels to an Axes object.R    g      g      ?t   autot   loct   bests   axes.labelsizeg333333?t   sizeN(!   R9   R;   R<   R"   t
   set_xlabelt
   set_ylabelt
   set_xticksR(   t   arangeR/   R:   t   set_xticklabelsR=   t
   set_ytickst   set_yticklabelst   xaxist   gridR   t   set_xlimt   yaxist   set_ylimR@   t   legendR?   t	   set_titleRo   t   rcParamst	   TypeErrort   font_managert   FontPropertiest   _legend_title_boxt   _textt   set_font_properties(   RB   t   axt   xlabelt   ylabelt   legt
   title_sizet   prop(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   annotate_axes  s6    &#c         C   sN   t  j d d g d d d |  j d d |  j d | d | } | j |  d S(   s3   Add a dummy patch object so we can get legend data.i    t	   linewidthi   t	   edgecolort	   facecolorRc   N(   t   pltt	   RectangleR   Rr   t	   add_patch(   RB   R   Rs   Rc   t   rect(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   add_legend_data  s    		N(   t   __name__t
   __module__R   Ri   R"   RX   R8   R|   R7   t   propertyR   R   R   R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR      s   			;-		)t   _BoxPlotterc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   sv   |  j  | | | | | | |  |  j | |	 |
  | |  _ | |  _ | |  _ | d  k ri t j d } n  | |  _ d  S(   Ns   lines.linewidth(	   RX   R|   R   R   t	   fliersizeR"   Ro   R   R   (   RB   RC   RD   RE   RF   RG   RH   R9   Rs   Rt   Ru   R   R   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   __init__  s    			c         C   s  |  j  d k } i  } x7 d d d d d g D]  } | j | d i   | | <q+ Wxt |  j  D]\ } } |  j d k r| j d k r q_ n  t |  } | j d k r q_ n  | j | d	 | d
 t	 d | g d |  j
 | }	 |  j | }
 |  j |	 |
 |  q_ |  j } x t |  j  D] \ } } | sK|  j | |  j | |  n  | j d k r`qn  |  j | | k } t | |  } | j d k rqn  | | | } | j | d	 | d
 t	 d | g d |  j | }	 |  j |	 |  j | |  qWq_ Wd S(   s,   Use matplotlib to draw a boxplot on an Axes.R    t   boxt   whiskert   capt   mediant   fliert   propsi    t   vertt   patch_artistt	   positionst   widthsN(   R9   t   popt	   enumerateR:   R>   R"   R   R	   R   R   R   Rp   t   restyle_boxplotR   R@   R   R   (   RB   R   t   kwsR   R   t   objRQ   t
   group_datat   box_datat   artist_dictRs   R   t   jt	   hue_levelt   hue_maskt   center(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_boxplot  sJ    					c   	      C   s  xQ | d D]E } | j  t d | d d d |  j d |  j   | j  | d  q WxK | d D]? } | j  t d	 |  j d |  j d
 d   | j  | d  q_ WxE | d D]9 } | j  t d	 |  j d |  j   | j  | d  q WxE | d D]9 } | j  t d	 |  j d |  j   | j  | d  q WxT | d D]H } | j  t d |  j d d d |  j d |  j   | j  | d  q=Wd S(   s6   Take a drawn matplotlib boxplot and make it look nice.t   boxesR   t   zorderg?R   R   R   t   whiskersRs   t	   linestylet   -R   t   capsR   t   mediansR   t   flierst   markerfacecolort   markerRR   t   markeredgecolort
   markersizeR   N(   t   updateRk   Rr   R   R   (	   RB   R   Rs   R   R   t   whiskR   t   medt   fly(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s2    		
	c         C   s=   |  j  | |  |  j |  |  j d k r9 | j   n  d S(   s   Make the plot.R   N(   R   R   R9   t   invert_yaxis(   RB   R   t   boxplot_kws(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   plot#  s    (   R   R   R   R   R   R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s   		>	t   _ViolinPlotterc           B   s   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z e	 d    Z
 d   Z d	   Z d
   Z e d  Z d   Z e d  Z d   Z d   Z RS(   c         C   sI  |  j  | | | | | | |  |  j | | |  |  j | | |	 |
 |  | |  _ | |  _ | |  _ | d  k	 r t | j d  | j d  | j d  | j d  g  s d j	 |  } t
 |   q n  | |  _ | r|  j d  k	 rt |  j  d k rd } t
 |   n  | |  _ | d  k r<t j d } n  | |  _ d  S(	   Nt   quartR   t   stickt   points   Inner style '{}' not recognizedi   s5   There must be exactly two hue levels to use `split`.'s   lines.linewidth(   RX   R|   t   estimate_densitiest   gridsizeR   R   R"   t   anyR4   R6   R#   t   innerR@   R/   t   splitRo   R   R   (   RB   RC   RD   RE   RF   RG   RH   t   bwt   cutt   scalet	   scale_hueR   R   R   R   R   R9   R   Rs   Rt   Ru   RT   t   msg(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   -  s*    				*	c         C   s  |  j  d k rN g  } g  } t j t |  j   } t j t |  j   }	 nt g  |  j D] }
 g  ^ qX } g  |  j D] }
 g  ^ qt } t |  j  t |  j   f } t j |  } t j |  }	 x~t |  j  D]m\ } } |  j d k r+t	 |  } | j
 d k rQ| j t j g    | j t j d g   d | | <d |	 | <q na t j |  j
 d k r| j t j |   | j t j d g   d | | <d |	 | <q n  |  j | |  \ } } |  j | | | |  } | j |  } | j |  | j |  | j
 | | <| j   |	 | <q xt |  j   D] \ } } | j
 s| | j t j g    | | j t j d g   d | | | f <d |	 | | f <q;n  |  j | | k } t	 | |  } | j
 d k r<| | j t j g    | | j t j d g   d | | | f <d |	 | | f <q;nu t j |  j
 d k r| | j t j |   | | j t j d g   d | | | f <d |	 | | f <q;n  |  j | |  \ } } |  j | | | |  } | j |  } | | j |  | | j |  | j
 | | | f <| j   |	 | | f <q;Wq W| d k re|  j | |	 |  nS | d k r|  j |  n7 | d k r|  j | | |  n t d j |    | |  _ | |  _ d S(	   s1   Find the support and density for all of the data.i    g      ?i   t   areaR   t   counts    scale method '{}' not recognizedN(   R@   R"   R(   R   R/   R:   R=   R   R>   R	   R   R*   R]   t   uniquet   fit_kdet   kde_supportt   evaluatet   maxt
   scale_areat   scale_widtht   scale_countR#   R6   t   supportt   density(   RB   R   R   R   R   R   R  R  t   countst   max_densityRW   R   RQ   R   t   kde_datat   kdet   bw_usedt	   support_it	   density_iR   R   R   t
   support_ijt
   density_ij(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   L  s    



		c         C   s   y t  j | |  } WnE t k
 r] t  j |  } | d k r^ d } t j | t  q^ n X| j } | | j d d  } | | f S(   s<   Estimate a KDE for a vector of data with flexible bandwidth.t   scottsM   Ignoring bandwidth choice, please upgrade scipy to use a different bandwidth.t   ddofi   (   R   t   gaussian_kdeR   t   warningst   warnt   UserWarningt   factort   std(   RB   RC   R   R	  R   R
  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    	c         C   s;   | j    | | } | j   | | } t j | | |  S(   s(   Define a grid of support for the violin.(   Rn   R   R(   R   (   RB   RC   R   R   R   t   support_mint   support_max(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    c         C   s   |  j  d k rE x | D]( } | j d k r | | j   } q q Wno xl t |  D]^ \ } } xO | D]G } | r | | j   } n | j   } | j d k re | | } qe qe WqR Wd S(   s   Scale the relative area under the KDE curve.

        This essentially preserves the "standard" KDE scaling, but the
        resulting maximum density will be 1 so that the curve can be
        properly multiplied by the violin width.

        i   N(   R@   R"   R   R   R   (   RB   R  R  R   RR   RQ   t   groupR   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s    c         C   si   |  j  d k r3 xS | D] } | | j   } q Wn2 x/ | D]' } x | D] } | | j   } qG Wq: Wd S(   s,   Scale each density curve to the same height.N(   R@   R"   R   (   RB   R  RR   R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s    c   
      C   s%  |  j  d k rq | j   d k r* d } q!x t | |  D]0 \ } } | | j   } | | | j   9} q: Wn x t |  D] \ } } x t |  D] \ } } | | j   d k r d } q | | | f } | r | | | j   }	 n | | j   }	 | | j   } | |	 9} q Wq~ Wd S(   s7   Scale each density curve by the number of observations.i    N(   R@   R"   R   t   zipR   (
   RB   R  R  R   RR   R   RQ   R  R   t   scaler(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s     		c         C   sT   |  j  d  k s |  j r$ |  j d S|  j r8 |  j d S|  j d t |  j   Sd  S(   Ni   (   R@   R"   R   R   R   R/   (   RB   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   dwidth  s
    	c      
   C   s  |  j  d k r | j n | j } xt |  j  D]\ } } t d |  j d |  j  } |  j d k r|  j
 | |  j | } } | j d k r q1 nI | j d k r t j |  } t j |  }	 |  j | | | |	  q1 n  t j |  j  | }
 | | |
 | |  j |
 | |  j d |  j | | |  j d k rAq1 n  t |  } |  j j d  r{|  j | | | | |  q|  j j d  r|  j | | | | |  q|  j j d	  r|  j | | | | |  q|  j j d
  r|  j | | |  qq1 |  j } xt |  j  D]\ } } |  j
 | | |  j | | } } |  j | | d <| s~|  j | |  j | |  n  | j d k rqnm | j d k r t j |  } t j |  }	 |  j r|	 d }	 n  | | | } |  j | | | |	  qn  |  j rt j |  j  | }
 | rF| | |
 |
 | |  j |  n | | |
 | |  j |
 |  |  j d k ryqn  |  j | | k } t | |  } |  j j d  r|  j | | | | | d d g |  n; |  j j d	  r|  j | | | | | d d g |  n  | sqn  t |  } |  j j d  rX|  j | | | | |  q|  j j d
  r|  j | | |  qqt j |  j  | | | }
 | | |
 | |  j |
 | |  j |  |  j d k rqn  |  j | | k } t | |  } |  j j d  r8|  j | | | | | | |  q|  j j d  rn|  j | | | | | | |  q|  j j d	  r|  j | | | | | | |  q|  j j d
  r|  j | | | | |  qqWq1 Wd S(   s   Draw the violins onto `ax`.R    R   R   i    i   R   R   R   R   R   i   t   leftt   rightN(   R9   t   fill_betweenxt   fill_betweenR   R:   Rk   Rr   R   R>   R"   R  R  R   R(   t   asscalart   draw_single_observationt   onesR   R  Rp   R   R	   R4   t   draw_box_linest   draw_quartilest   draw_stick_linest   draw_pointsR   R@   R   R   (   RB   R   t	   fill_funcRQ   R   R   R  R  t   valRR   R   t   violin_dataR   R   R   t   at_groupR   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_violins'  s    !
	#		
		c         C   s   | |  j  } |  j d k rU | j | | | | g | | g d |  j d |  j n6 | j | | g | | | | g d |  j d |  j d S(   s)   Draw a line to mark a single observation.R    Rs   R   N(   R  R9   R   Rr   R   (   RB   R   R+  t   at_quantR  t   d_width(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR"    s    		c         C   s  t  j | d d d g  \ } } } d t |  }	 t  j | | | |	 k  }
 t  j | | | |	 k  } |  j d k r| j | | g |
 | g d |  j d |  j | j | | g | | g d |  j d d |  j | j	 | | d	 d d d
 d |  j d t  j
 |  j d  n | j |
 | g | | g d |  j d |  j | j | | g | | g d |  j d d |  j | j	 | | d	 d d d
 d |  j d t  j
 |  j d  d S(   s2   Draw boxplot information at center of the density.i   i2   iK   g      ?R    R   Rs   i   R   t   whiteR   RN   i   N(   R(   t
   percentileR   Rn   R   R9   R   R   Rr   t   scattert   square(   RB   R   RF   R  R  R   t   q25t   q50t   q75t   whisker_limt   h1t   h2(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR$    s6    $	

		

	c   
      C   s   t  j | d d d g  \ } } }	 |  j | | | | | | d |  j d |  j d g d |  j | | | | | | d |  j d |  j d g d |  j | | |	 | | | d |  j d |  j d g d d	 S(
   s0   Draw the quartiles as lines at width of density.i   i2   iK   R   t   dashesg      ?i   i   N(   R(   R0  t   draw_to_densityR   (
   RB   R   RF   R  R  R   R   R3  R4  R5  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR%  	  s    $			c         C   s   t  d t j |  j d  d |  j d |  j  } t j t |   | } |  j d k ro | j | | |  n | j | | |  d S(   s?   Draw individual observations as points at middle of the violin.RN   i   Rs   R   R    N(	   Rk   R(   R2  R   Rr   R#  R/   R9   R1  (   RB   R   RF   R   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR'    s    	c         C   s>   x7 | D]/ } |  j  | | | | | | d |  j d q Wd S(   s;   Draw individual observations as sticks at width of density.R   g      ?N(   R:  R   (   RB   R   RF   R  R  R   R   R)  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR&  $  s    c   
      K   sj  t  j t  j | |   } |  j | | d }	 |  j | d <|  j d k r | d k r | j | |	 | g | | g |  qf| d k r | j | | |	 g | | g |  qf| j | |	 | |	 g | | g |  n | d k r| j | | g | |	 | g |  nY | d k r?| j | | g | | |	 g |  n' | j | | g | |	 | |	 g |  d S(   s=   Draw a line orthogonal to the value axis at width of density.gGz?Rs   R    R  R  N(   R(   t   argmint   absR  Rr   R9   R   (
   RB   R   R   R)  R  R  R   R   t   idxR   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR:  +  s    &&*&&c         C   s:   |  j  |  |  j |  |  j d k r6 | j   n  d S(   s   Make the violin plot.R   N(   R,  R   R9   R   (   RB   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   A  s    (   R   R   R   R   R   R   R  R  R  R   R  R,  R"  R$  R   R%  R'  R&  R:  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   +  s    		}				
	
			"		t   _CategoricalScatterPlotterc           B   s&   e  Z d  Z e d    Z d   Z RS(   Rf   c   	      C   s   g  } x t  |  j  D] \ } } t j | j d f  } |  j d k r` |  j | } | | (nP xM t  |  j  D]< \ } } |  j | } | j rp | | |  j | | k <qp qp W| j	 |  q W| S(   s=   Return a color for each scatter point based on group and hue.i   N(
   R   R:   R(   t   emptyR   R>   R"   Rp   R@   R*   (	   RB   Rp   RQ   R   t   group_colorst   group_colorR   t   levelt	   hue_color(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   point_colorsM  s    
	c      
   C   sj   |  j  d k	 rf xT t |  j |  j   D]: \ } } | j g  g  d t j j |  d | d d q% Wn  d S(   s9   Add empty scatterplot artists with labels for the legend.Rs   Rc   RN   i<   N(   R@   R"   R  Rp   R1  Ro   Rq   (   RB   R   t   rgbRc   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   h  s    "(   R   R   Ri   R   RD  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR>  I  s   t   _StripPlotterc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s.   1-d scatterplot with categorical organization.c         C   s   |  j  | | | | |	 | |  |  j |
 | d  | |  _ d |  _ | d k rY d } n t |  } |  j d k	 r | r | t |  j  } n  t j	 | | d  j
 |  _ d S(   s   Initialize the plotter.i   g?g?i   N(   RX   R|   R   R   R)   R@   R"   R/   R   t   uniformt   rvst   jitterer(   RB   RC   RD   RE   RF   RG   RH   t   jitterR   R9   Rs   Rt   t   jlim(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   t  s    			c         C   s  xt  |  j  D]\ } } |  j d k s5 |  j r&|  j d k r_ t j | j t j	  } n8 t j
 g  |  j | D] } | |  j k ^ qs t j	  } | | } t j | j  | } | |  j t |   7} | j d |  j | |  |  j d k r| j | | |  q| j | | |  q |  j }	 x t  |  j  D] \ }
 } |  j | | k } | | } | |	 |
 } t j | j  | } | |  j t |   7} | j d |  j | |  |  j d k r| j | | |  q?| j | | |  q?Wq Wd S(   s   Draw the points onto `ax`.Ry   R    N(   R   R:   R>   R"   R   R@   R(   R#  R   t   boolR]   RI  R/   R   RD  R9   R1  R   (   RB   R   R   RQ   R   R   R   t
   strip_datat   cat_posR   R   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_stripplot  s0    	/
	
c         C   sJ   |  j  | |  |  j |  |  j |  |  j d k rF | j   n  d S(   s   Make the plot.R   N(   RO  R   R   R9   R   (   RB   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s
    (   R   R   t   __doc__R   RO  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyRF  r  s   		*t   _SwarmPlotterc           B   sY   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   c         C   sH   |  j  | | | | | | |  |  j |	 |
 d  | |  _ d |  _ d S(   s   Initialize the plotter.i   g?N(   RX   R|   R   R   (   RB   RC   RD   RE   RF   RG   RH   R   R9   Rs   Rt   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    	c   	      C   so   | \ } } g  } xA t  |  D]3 } | \ } } | | | k  rQ | j |  q Pq Wt j t t  |    S(   s   Return a list of all swarm points that could overlap with target.

        Assumes that swarm is a sorted list of all points below xy_i.
        (   t   reversedR*   R(   R]   R1   (	   RB   t   xy_it   swarmRR   RW   t   y_it	   neighborst   xy_jt   y_j(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   could_overlap  s    c         C   s   | g } | \ } } t  } x | D] \ } }	 | |	 }
 t j | d |
 d  d } | | | f | | | f } } | r | | g } n | | g } | j |  | } q" Wt j |  S(   s8   Return a list of (x, y) coordinates that might be valid.i   g?(   R   R(   t   sqrtt   extendR]   (   RB   RS  RV  RR   t
   candidatest   x_iRU  t
   left_firstt   x_jRX  t   dyt   dxt   clt   crt   new_candidates(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   position_candidates  s    	
!c         C   s   t  |  d k r | d S| d d  d f } | d d  d f } | d } xo | D]g } | \ } }	 | | }
 | |	 } t j |
 d  t j | d  } t j | | k  } | rW | SqW Wt d   d S(   s?   Remove candidates from the list if they overlap with the swarm.i    Ni   i   g       @s<   No non-overlapping candidates found. This should not happen.(   R/   R(   t   powert   allt	   Exception(   RB   R\  RV  RR   t   neighbors_xt   neighbors_yt   d_squareRS  R]  RU  Ra  R`  t   sq_distancest   good_candidate(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   first_non_overlapping_candidate  s    


"c   
      C   s   | d } | d g } x | d D] } |  j  | | |  } |  j | | |  } t j | d d  d f |  } | t j |  } |  j | | |  }	 | j |	  q" Wt j |  S(   s.   Adjust x position of points to avoid overlaps.i    i   N(   i    i    (   RY  Re  R(   R<  t   argsortRn  R*   R]   (
   RB   t   orig_xyRR   t   midlineRT  RS  RV  R\  R   t   new_xy_i(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   beeswarm  s    
#	c   	      C   sl   | d } | | } | | k  } | j    r9 | | | <n  | | } | | k } | j    rh | | | <n  | S(   s2   Stop points from extending beyond their territory.i   (   R   (	   RB   t   pointsR   R   t
   half_widtht
   low_guttert   off_lowt   high_guttert   off_high(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   add_gutters(  s    


c         K   sO  t  j d } | j d | j d |   } | j j }	 t j |  | |	 d }
 | j j | j	    } |  j
 d k r | d d  d d g f } n  |  j | |
  } |  j
 d k r | d d  d d g f } n  | j j   j |  j \ } } |  j
 d	 k r|  j | | |  n |  j | | |  | j t j | | f  d S(
   s:   Find new positions on the categorical axis for each point.s   patch.linewidthR   t   lwiH   R   Ni   i    R    (   Ro   R   R5   t   figuret   dpiR(   RZ  t	   transDatat	   transformt   get_offsetsR9   Rs  t   invertedt   TRz  t   set_offsetst   c_(   RB   R   Rt  R   R   RN   R   t
   default_lwR{  R}  RR   Rp  t   new_xyt   new_xt   new_y(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   swarm_points5  s    !c         C   s3  | j  d  } g  } g  } |  j d k rJ | j d t |  j  d  n | j d t |  j  d  xwt |  j  D]f\ } } |  j d k s |  j	 r|  j
 } |  j d k r t j | j t j  }	 n8 t j g  |  j | D] }
 |
 |  j k ^ q t j  }	 | |	 } t j |  } | | } |  j | |	 | } t j | j  | } | j d |  |  j d k r| j | | d | | } n | j | | d | | } | j |  | j |  qw |  j } |  j } x t |  j  D] \ } } |  j | | k }	 | |	 } t j |  } | | } |  j | |	 | } | | | } t j | j  | } | j d |  |  j d k r| j | | d | | } n | j | | d | | } | j |  | j |  qWqw WxK t | |  D]: \ } } | j   j r|  j | | | | | |  qqWd S(   s   Plot the data.RN   R    g      g      ?Ry   N(   R   R9   R   R/   R:   R   R   R>   R"   R   R   R@   R(   R#  R   RL  R]   Ro  RD  R   R1  R*   R   R   R  R  R  (   RB   R   R   RN   t   centerst   swarmsRQ   R   R   R   R   t
   swarm_datat   sorterRD  RN  Rt  R   R   R   R   RT  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_swarmplotW  sV     		/

		

c         C   sJ   |  j  | |  |  j |  |  j |  |  j d k rF | j   n  d S(   s   Make the full plot.R   N(   R  R   R   R9   R   (   RB   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s
    (   R   R   R   RY  Re  Rn  Rs  Rz  R  R  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyRQ    s   	
			"	!		"	Mt   _CategoricalStatPlotterc           B   s/   e  Z e d     Z d   Z d d d  Z RS(   c         C   s/   |  j  r" |  j t |  j  } n	 |  j } | S(   sA   A float with the width of plot elements when hue nesting is used.(   R   R   R/   R@   (   RB   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    		c      
   C   s  |  j  d  k r g  } g  } n8 g  |  j D] } g  ^ q( } g  |  j D] } g  ^ qD } xt |  j  D]q\ } } |  j d  k r|  j d  k r t |  }	 d  }
 nI |  j | }
 t j t	 j
 | |
 f  j d d  } | | }	 |
 | }
 |	 j s
| j t	 j  n | j | |	   | d  k	 r|	 j d k  rW| j t	 j t	 j g  qf n  | d k r| |	  } t	 j |	  } | j | | | | f  qt |	 d | d | d |
 } | j t j | |   qqf xt |  j   D]\ } } |  j | j sK| | j t	 j  | d  k	 r| | j t	 j t	 j f  qqn  |  j | | k } |  j d  k rt | |  }	 d  }
 nQ |  j | } t j t	 j
 | | f  j d d  } | | | @}	 | | | @}
 |	 j s| | j t	 j  n | | j | |	   | d  k	 r|	 j d k  rL| | j t	 j t	 j g  qn  | d k r| |	  } t	 j |	  } | | j | | | | f  qt |	 d | d | d |
 } | | j t j | |   qqWqf Wt	 j |  |  _ t	 j |  |  _ d  S(   Nt   axisi   i   t   sdt   funct   n_bootRI   (   R@   R"   R:   R   R>   RA   R	   R%   t   notnullR(   R  Rg  R   R*   t   nanR  R
   R   t   ciR]   t	   statistict   confint(   RB   t	   estimatorR  R  R  R  RW   RQ   R   t	   stat_datat	   unit_datat   havet   estimateR  t   bootsR   R   R   t   group_units(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   estimate_statistic  s|    		(

		 			"	(c         K   s  | d  k	 r | j d |  n | j d t j d d  xwt | | |  D]c\ } \ }	 }
 } |  j d k r| j | | g |	 |
 g d | | | d  k	 r| j | | d | | d g |	 |	 g d | | | j | | d | | d g |
 |
 g d | | qqM | j |	 |
 g | | g d | | | d  k	 rM | j |	 |	 g | | d | | d g d | | | j |
 |
 g | | d | | d g d | | qM qM Wd  S(   NR{  s   lines.linewidthg?R    Rs   i   (   R"   t
   setdefaultRo   R   R  R9   R   (   RB   R   R+  R  Rp   t   errwidtht   capsizeR   t   att   ci_lowt   ci_highRs   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_confints!  s*    	%%
N(   R   R   R   R   R  R"   R  (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s   		jt   _BarPlotterc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s8   Show point estimates and confidence intervals with bars.c      	   C   sp   |  j  | | | | | | | |
  |  j | | |  |  j | | |	  | |  _ | |  _ | |  _ | |  _ d S(   s   Initialize the plotter.N(   RX   R|   R  R   t   errcolorR  R  (   RB   RC   RD   RE   RF   RG   RH   R  R  R  RI   R9   Rs   Rt   Ru   R  R  R  R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   A  s    			c   
      C   s  |  j  d k r | j n | j } t j t |  j   } |  j d k r | | |  j |  j	 d |  j
 d d | |  j g t |  } |  j | | |  j | |  j |  j  n x t |  j  D] \ } } | |  j | } | | |  j d d  | f |  j d |  j
 | d d d | | |  j j r |  j d d  | f }	 |  j g t |  } |  j | | |	 | |  j |  j  q q Wd S(   s   Draw the bars onto `ax`.R    Rs   t   alignR   NRc   (   R9   t   bart   barhR(   R   R/   R  R>   R"   R   Rp   R  R  R  R  R  R   R@   R   R   R   (
   RB   R   R   t   barfunct   barpost	   errcolorsR   R   t   offposR  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt	   draw_barsQ  s4    !	%
	c         C   s=   |  j  | |  |  j |  |  j d k r9 | j   n  d S(   s   Make the plot.R   N(   R  R   R9   R   (   RB   R   t   bar_kws(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   {  s    (   R   R   RP  R   R  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR  >  s   		*t   _PointPlotterc           B   s>   e  Z d  Z d d d  Z e d    Z d   Z d   Z RS(   Rf   c      	   C   st  |  j  | | | | | | | |
  |  j | | d  |  j | | |	  | d k r | d k r | d k r t   d g t |  j  |  _ n  | d k r | d k	 r t } n  | t k r |  j	 d k	 r d t |  j	  } n  t
 | t  r	| g t |  j  } n  | |  _ t
 | t  r:| g t |  j  } n  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ d S(   s   Initialize the plotter.i   i    g?N(   RX   R|   R  R"   R   R/   Rp   R   R   R@   R$   R   t   markerst
   linestylesR   t   joinR   R  R  (   RB   RC   RD   RE   RF   RG   RH   R  R  R  RI   R  R  R   R  R   R9   Rs   Rt   R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s*    $#							c         C   sY   |  j  r= t j d |  j  t |  j   } | | j   8} n t j t |  j   } | S(   s;   Offsets relative to the center position for each hue level.i    (   R   R(   R   R/   R@   R   R   (   RB   t   offset(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s
    	!c         C   s  t  j t |  j   } t j d d |  j } | d } t  j t  j |  d } |  j	 d k r|  j r |  j d } |  j d } |  j d k r | j |  j | d | d | d	 | q | j | |  j d | d | d	 | n  |  j | | |  j |  j |  j |  j  |  j d } g  |  j D] }	 t j j |	  ^ q$}
 |  j d k rd|  j | } } n | |  j } } | j | | d
 | d | d | d |
 d |
 n:|  j } x.t |  j  D]\ } } |  j d d  | f } | | | } | d } |  j r|  j | } |  j | } |  j d k rX| j | | d | d | d | d	 | q| j | | d | d | d | d	 | n  |  j j r|  j d d  | f } |  j | g t |  } |  j | | | | |  j |  j d | n  t t |   } |  j | } t j j |  j |  } | rMg  t |  D] } | ^ q8} n | } |  j d k rr| | } } n | | } } t t |   sg  g  } } n  | j | | d | d | d | d
 | d | d | d | qWd S(   s*   Draw the main data components of the plot.s   lines.linewidthg?g      ?i   i    R   Rs   t   lsR{  R   R   RN   Ry   R   Ni   R   Rc   (   R(   R   R/   R  Ro   R   R   t   piR2  R>   R"   R  Rp   R  R9   R   R  R  R  R  R  Rq   R1  R   R   R@   R   R	   R   (   RB   R   t   pointposR{  t   mewR   Rs   R  R   Ry   t
   hex_colorsRC   RD   R   R   R   R  R  t   zR  R  t   n_pointst	   hex_colorRW   RD  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR'    sr    
	(	
	
"c         C   s:   |  j  |  |  j |  |  j d k r6 | j   n  d S(   s   Make the plot.R   N(   R'  R   R9   R   (   RB   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    N(	   R   R   Ri   R"   R   R   R   R'  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s
   $
	Xt
   _LVPlotterc           B   sk   e  Z d    Z d d d  Z d   Z d   Z d d d g e d	 d d d d
 d  Z d   Z	 d   Z
 RS(   c         C   s   | d  k r d } n  | |  _ | |  _ |
 d  k r< d }
 n  |
 |  _ | d  k rZ d } n  | |  _ | d  k r t j d } n  | |  _ | d  k r d } n  | |  _ | |  _	 |  j
 | | | | | | |  |  j | |	 |
  d  S(   Ng?g      ?t
   proportions   lines.linewidtht   exponential(   R"   R   R   Ru   t   k_depthRo   R   R   R   t   outlier_propRX   R|   (   RB   RC   RD   RE   RF   RG   RH   R9   Rs   Rt   Ru   R   R   R  R   R   R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s&    											R  c         C   s  t  j |  } | t  j |  } t |  } | s= d } n- | d k sU | d k  rd t d   n  | } i t  j |  t t  j | |   d d 6t  j |  d d 6t  j |  t  j d	 t j j	 d |  d	  d d
 6} | | } y t |  } Wn t k
 rd } n X| d k  r1d } n  g  t
 | d d  D] } d d d | d	 ^ qD}	 g  t
 | d d  D] } d d | d	 ^ qy}
 g  t |
 |	  D] \ } } | | f ^ q} g  | D] } t  j | |  ^ q} | | f S(   sQ   Get the number of data points and calculate `depth` of
        letter-value plot.gy&1|?g      ?g        s!   outlier_prop not in range [0, 1]!i   R  i   t   tukeyi   t   trustworthyiid   g      ?(   R(   R-   t   isfiniteR/   R#   t   log2t   intR   t   normt   ppfR   R  R0  (   RB   RU   R  R  t   nt   pt   k_dictRM   RQ   t   uppert   lowerR   t   percentile_endst   qt   box_ends(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   _lv_box_ends;  s0    	.0

	51.%c         C   s   d d | d d d d | d f } t  j | |  } | t  j | | d k   d } | t  j | | d k  d } t  j | | f  S(   s2   Find the outliers based on the letter value depth.id   g      ?i   i   i    (   R(   R0  t   wheret   concatenate(   RB   RU   RM   t	   perc_endst   edgest	   lower_outt	   upper_out(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   _lv_outliers`  s
    (!!c         C   s,   i d   d 6d   d 6d   d 6} | | S(   Nc         S   s   | d | S(   Ng      ?(    (   R   RQ   RM   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   <lambda>j  s    t   linearc         S   s   d | | d S(   Ni   i   (    (   R   RQ   RM   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR  k  s    R  c         S   s   d d | | d |  S(   Ni   i   (    (   R   RQ   RM   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR  l  s    R   (    (   RB   t
   width_funct   width_functions(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   _width_functionsh  s    
g     o@g      p@g      g@g        i   R  c
      	      s  | d } t  j |  } t |  d k r |
 j i |  j d 6d d 6 | d | d g } |  d |  d g } | r | | } } n | | } } | j | | |
  n|  j | d | d | \ } } |  j |	  } d	        f d
   }    f d   } t  j g  t	 |  D]$ \ } } |   |  | |  ^ q" } | t  j
 |  } t  j |  } |  j | |  } | rLg  t	 t | |   D], \ } } | | | d | | | d  ^ q} | j |  d |  d g | | g d d d d |
 | j t  j | t |   | d d d t j j |  |
 n g  t	 t | |   D], \ } } | | | d | | | d  ^ qb} | j | | g |  d |  d g d d d d |
 | j | t  j | t |   d d d | |
 d d d g t |  g } t j j j d |  } t | d | } | j t  j t  j d d t |     | j |  d  S(   Ni    i   Rs   R   R   i   R  R  c         S   s   |  d |  d S(   Ni   i    (    (   t   b(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   height  s    c            s?   t  j |   | d | d f  |   |  d t } | S(   Ni   i    t   fill(   t   PatchesR   R   (   RC   R  RQ   RM   t   wR   (   R  R   (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   vert_perc_box  s    c            s?   t  j | d |   | d f   |   | d t } | S(   Ni    i   R  (   R  R   R   (   RC   R  RQ   RM   R  R   (   R  R   (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   horz_perc_box  s    	Ry   s   .15t   alphag?R   RR   t   new_mapt   cmap(   R(   R-   R/   R   Rr   R   R  R  R]   R   R   R   R  R  R1  t   repeatRo   Rp   Rq   R1   t   LinearSegmentedColormapt	   from_listR   t	   set_arrayR   t   add_collection(   RB   R   R   Rs   R   R   R  R   R  R   R   RC   t   yst   xst   xxt   yyR  RM   R   R  R  RQ   R  t   w_areaRD   t   outliersR   RE  R  t
   collection(    (   R  R   s2   lib/python2.7/site-packages/seaborn/categorical.pyt   _lvploto  sN    
		7E+!E+!+c         C   s  |  j  d k } xt |  j  D]\ } } |  j d k r | j d k rO q n  t |  } | j d k rp q n  |  j | } |  j | d | g d | d | d |  j	 d |  j
 d | d	 |  j d
 |  j | q |  j } x t |  j  D] \ }	 }
 | s|  j | |  j |	 |
  n  | j d k r,q n  |  j | |
 k } t | |  } | j d k rdq n  |  j |	 } | | |	 } |  j | d | g d | d | d |  j d |  j
 d | d	 |  j d
 |  j | q Wq Wd S(   s6   Use matplotlib to draw a letter value plot on an Axes.R    i    R   Rs   R   R   R  R   R   R  N(   R9   R   R:   R>   R"   R   R	   Rp   R  R   R  R   R  R   R@   R   R   (   RB   R   R   R   RQ   R   R   Rs   R   R   R   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   draw_letter_value_plot  sR    				
					c         C   s=   |  j  | |  |  j |  |  j d k r9 | j   n  d S(   s   Make the plot.R   N(   R  R   R9   R   (   RB   R   R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   
  s    Ng     ?g      ?(   R   R   R   R"   R  R  R  R   R  R  R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR    s   	 %			V	Bt   categorical_narratives      This function always treats one of the variables as categorical and
    draws data at ordinal positions (0, 1, ... n) on the relevant axis, even
    when the data has a numeric or date type.

    See the :ref:`tutorial <categorical_tutorial>` for more information.    t   main_api_narratives  
    Input data can be passed in a variety of formats, including:

    - Vectors of data represented as lists, numpy arrays, or pandas Series
      objects passed directly to the ``x``, ``y``, and/or ``hue`` parameters.
    - A "long-form" DataFrame, in which case the ``x``, ``y``, and ``hue``
      variables will determine how the data are plotted.
    - A "wide-form" DataFrame, such that each numeric column will be plotted.
    - An array or list of vectors.

    In most cases, it is possible to use numpy or Python objects, but pandas
    objects are preferable because the associated names will be used to
    annotate the axes. Additionally, you can use Categorical types for the
    grouping variables to control the order of plot elements.    t   input_paramss       x, y, hue : names of variables in ``data`` or vector data, optional
        Inputs for plotting long-form data. See examples for interpretation.        t   string_input_paramss       x, y, hue : names of variables in ``data``
        Inputs for plotting long-form data. See examples for interpretation.        t   categorical_datas       data : DataFrame, array, or list of arrays, optional
        Dataset for plotting. If ``x`` and ``y`` are absent, this is
        interpreted as wide-form. Otherwise it is expected to be long-form.    t   long_form_datas       data : DataFrame
        Long-form (tidy) dataset for plotting. Each column should correspond
        to a variable, and each row should correspond to an observation.    t
   order_varss       order, hue_order : lists of strings, optional
        Order to plot the categorical levels in, otherwise the levels are
        inferred from the data objects.        t   stat_api_paramss      estimator : callable that maps vector -> scalar, optional
        Statistical function to estimate within each categorical bin.
    ci : float or "sd" or None, optional
        Size of confidence intervals to draw around estimated values.  If
        "sd", skip bootstrapping and draw the standard deviation of the
        observations. If ``None``, no bootstrapping will be performed, and
        error bars will not be drawn.
    n_boot : int, optional
        Number of bootstrap iterations to use when computing confidence
        intervals.
    units : name of variable in ``data`` or vector data, optional
        Identifier of sampling units, which will be used to perform a
        multilevel bootstrap and account for repeated measures design.    R9   s      orient : "v" | "h", optional
        Orientation of the plot (vertical or horizontal). This is usually
        inferred from the dtype of the input variables, but can be used to
        specify when the "categorical" variable is a numeric or when plotting
        wide-form data.    Rs   sq       color : matplotlib color, optional
        Color for all of the elements, or seed for a gradient palette.    Rt   s       palette : palette name, list, or dict, optional
        Color palette that maps either the grouping variable or the hue
        variable. If the palette is a dictionary, keys should be names of
        levels and values should be matplotlib colors.    Ru   s      saturation : float, optional
        Proportion of the original saturation to draw colors at. Large patches
        often look better with slightly desaturated colors, but set this to
        ``1`` if you want the plot colors to perfectly match the input color
        spec.    R  s\            capsize : float, optional
             Width of the "caps" on error bars.
         R  sb            errwidth : float, optional
             Thickness of error bar lines (and caps).         R   s       width : float, optional
        Width of a full element when not using hue nesting, or width of all the
        elements for one level of the major grouping variable.    R   s       dodge : bool, optional
        When hue nesting is used, whether elements should be shifted along the
        categorical axis.    R   sa       linewidth : float, optional
        Width of the gray lines that frame the plot elements.    t   ax_insr       ax : matplotlib Axes, optional
        Axes object to draw the plot onto, otherwise uses the current Axes.    t   ax_outsY       ax : matplotlib Axes
        Returns the Axes object with the plot drawn onto it.    sH       boxplot : A traditional box-and-whisker plot with a similar API.    sL       violinplot : A combination of boxplot and kernel density estimation.    s       stripplot : A scatterplot where one variable is categorical. Can be used
                in conjunction with other plots to show each observation.    s       swarmplot : A categorical scatterplot where the points do not overlap. Can
                be used with other plots to show each observation.    sK       barplot : Show point estimates and confidence intervals using bars.    sL       countplot : Show the counts of observations in each categorical bin.    sk       pointplot : Show point estimates and confidence intervals using scatterplot
                glyphs.    sF       catplot : Combine a categorical plot with a class:`FacetGrid`.    s<       boxenplot : An enhanced boxplot for larger datasets.    g      ?g?i   g      ?c         K   s~   t  |  | | | | | | | | |	 |
 | | |  } | d  k rN t j   } n  | j t d | d |   | j | |  | S(   Nt   whist   notch(   R   R"   R   t   gcaR   Rk   R   (   RC   RD   RE   RF   RG   RH   R9   Rs   Rt   Ru   R   R   R   R   R  R  R   t   kwargst   plotter(    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    s      Draw a box plot to show distributions with respect to categories.

    A box plot (or box-and-whisker plot) shows the distribution of quantitative
    data in a way that facilitates comparisons between variables or across
    levels of a categorical variable. The box shows the quartiles of the
    dataset while the whiskers extend to show the rest of the distribution,
    except for points that are determined to be "outliers" using a method
    that is a function of the inter-quartile range.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {width}
    {dodge}
    fliersize : float, optional
        Size of the markers used to indicate outlier observations.
    {linewidth}
    whis : float, optional
        Proportion of the IQR past the low and high quartiles to extend the
        plot whiskers. Points outside this range will be identified as
        outliers.
    notch : boolean, optional
        Whether to "notch" the box to indicate a confidence interval for the
        median. There are several other parameters that can control how the
        notches are drawn; see the ``plt.boxplot`` help for more information
        on them.
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to ``plt.boxplot`` at draw
        time.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {violinplot}
    {stripplot}
    {swarmplot}

    Examples
    --------

    Draw a single horizontal boxplot:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.boxplot(x=tips["total_bill"])

    Draw a vertical boxplot grouped by a categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="day", y="total_bill", data=tips)

    Draw a boxplot with nested grouping by two categorical variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="day", y="total_bill", hue="smoker",
        ...                  data=tips, palette="Set3")

    Draw a boxplot with nested grouping when some bins are empty:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="day", y="total_bill", hue="time",
        ...                  data=tips, linewidth=2.5)

    Control box order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="time", y="tip", data=tips,
        ...                  order=["Dinner", "Lunch"])

    Draw a boxplot for each numeric variable in a DataFrame:

    .. plot::
        :context: close-figs

        >>> iris = sns.load_dataset("iris")
        >>> ax = sns.boxplot(data=iris, orient="h", palette="Set2")

    Use ``hue`` without changing box position or width:

    .. plot::
        :context: close-figs

        >>> tips["weekend"] = tips["day"].isin(["Sat", "Sun"])
        >>> ax = sns.boxplot(x="day", y="total_bill", hue="weekend",
        ...                  data=tips, dodge=False)

    Use :func:`swarmplot` to show the datapoints on top of the boxes:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="day", y="total_bill", data=tips)
        >>> ax = sns.swarmplot(x="day", y="total_bill", data=tips, color=".25")

    Use :func:`catplot` to combine a :func:`pointplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="box",
        ...                 height=4, aspect=.7);

    R  i   R   id   R   c         K   sq   t  |  | | | | | | | | |	 |
 | | | | | | | | |  } | d  k r` t j   } n  | j |  | S(   N(   R   R"   R   R  R   (   RC   RD   RE   RF   RG   RH   R   R   R   R   R   R   R   R   R   R9   R   Rs   Rt   Ru   R   R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   J	  s    s      Draw a combination of boxplot and kernel density estimate.

    A violin plot plays a similar role as a box and whisker plot. It shows the
    distribution of quantitative data across several levels of one (or more)
    categorical variables such that those distributions can be compared. Unlike
    a box plot, in which all of the plot components correspond to actual
    datapoints, the violin plot features a kernel density estimation of the
    underlying distribution.

    This can be an effective and attractive way to show multiple distributions
    of data at once, but keep in mind that the estimation procedure is
    influenced by the sample size, and violins for relatively small samples
    might look misleadingly smooth.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    bw : {{'scott', 'silverman', float}}, optional
        Either the name of a reference rule or the scale factor to use when
        computing the kernel bandwidth. The actual kernel size will be
        determined by multiplying the scale factor by the standard deviation of
        the data within each bin.
    cut : float, optional
        Distance, in units of bandwidth size, to extend the density past the
        extreme datapoints. Set to 0 to limit the violin range within the range
        of the observed data (i.e., to have the same effect as ``trim=True`` in
        ``ggplot``.
    scale : {{"area", "count", "width"}}, optional
        The method used to scale the width of each violin. If ``area``, each
        violin will have the same area. If ``count``, the width of the violins
        will be scaled by the number of observations in that bin. If ``width``,
        each violin will have the same width.
    scale_hue : bool, optional
        When nesting violins using a ``hue`` variable, this parameter
        determines whether the scaling is computed within each level of the
        major grouping variable (``scale_hue=True``) or across all the violins
        on the plot (``scale_hue=False``).
    gridsize : int, optional
        Number of points in the discrete grid used to compute the kernel
        density estimate.
    {width}
    inner : {{"box", "quartile", "point", "stick", None}}, optional
        Representation of the datapoints in the violin interior. If ``box``,
        draw a miniature boxplot. If ``quartiles``, draw the quartiles of the
        distribution.  If ``point`` or ``stick``, show each underlying
        datapoint. Using ``None`` will draw unadorned violins.
    split : bool, optional
        When using hue nesting with a variable that takes two levels, setting
        ``split`` to True will draw half of a violin for each level. This can
        make it easier to directly compare the distributions.
    {dodge}
    {orient}
    {linewidth}
    {color}
    {palette}
    {saturation}
    {ax_in}

    Returns
    -------
    {ax_out}

    See Also
    --------
    {boxplot}
    {stripplot}
    {swarmplot}

    Examples
    --------

    Draw a single horizontal violinplot:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.violinplot(x=tips["total_bill"])

    Draw a vertical violinplot grouped by a categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", data=tips)

    Draw a violinplot with nested grouping by two categorical variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="smoker",
        ...                     data=tips, palette="muted")

    Draw split violins to compare the across the hue variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="smoker",
        ...                     data=tips, palette="muted", split=True)

    Control violin order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="time", y="tip", data=tips,
        ...                     order=["Dinner", "Lunch"])

    Scale the violin width by the number of observations in each bin:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="sex",
        ...                     data=tips, palette="Set2", split=True,
        ...                     scale="count")

    Draw the quartiles as horizontal lines instead of a mini-box:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="sex",
        ...                     data=tips, palette="Set2", split=True,
        ...                     scale="count", inner="quartile")

    Show each observation with a stick inside the violin:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="sex",
        ...                     data=tips, palette="Set2", split=True,
        ...                     scale="count", inner="stick")

    Scale the density relative to the counts across all bins:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="sex",
        ...                     data=tips, palette="Set2", split=True,
        ...                     scale="count", inner="stick", scale_hue=False)

    Use a narrow bandwidth to reduce the amount of smoothing:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", hue="sex",
        ...                     data=tips, palette="Set2", split=True,
        ...                     scale="count", inner="stick",
        ...                     scale_hue=False, bw=.2)

    Draw horizontal violins:

    .. plot::
        :context: close-figs

        >>> planets = sns.load_dataset("planets")
        >>> ax = sns.violinplot(x="orbital_period", y="method",
        ...                     data=planets[planets.orbital_period < 1000],
        ...                     scale="width", palette="Set3")

    Don't let density extend past extreme values in the data:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="orbital_period", y="method",
        ...                     data=planets[planets.orbital_period < 1000],
        ...                     cut=0, scale="width", palette="Set3")

    Use ``hue`` without changing violin position or width:

    .. plot::
        :context: close-figs

        >>> tips["weekend"] = tips["day"].isin(["Sat", "Sun"])
        >>> ax = sns.violinplot(x="day", y="total_bill", hue="weekend",
        ...                     data=tips, dodge=False)

    Use :func:`catplot` to combine a :func:`violinplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="violin", split=True,
        ...                 height=4, aspect=.7);

    c          O   s    d } t  j |  t |  |   S(   s#   Deprecated; please use `boxenplot`.s   The `lvplot` function has been renamed to `boxenplot`. The original name will be removed in a future release. Please update your code. (   R  R  R   (   t   argsR  R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   -
  s    R  R  c         K   sh   t  |  | | | | | | | | |	 |
 | | | | |  } | d  k rT t j   } n  | j | |  | S(   N(   R  R"   R   R  R   (   RC   RD   RE   RF   RG   RH   R9   Rs   Rt   Ru   R   R   R  R   R   R  R   R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   9
  s    	s      Draw an enhanced box plot for larger datasets.

    This style of plot was originally named a "letter value" plot because it
    shows a large number of quantiles that are defined as "letter values".  It
    is similar to a box plot in plotting a nonparametric representation of a
    distribution in which all features correspond to actual observations. By
    plotting more quantiles, it provides more information about the shape of
    the distribution, particularly in the tails. For a more extensive
    explanation, you can read the paper that introduced the plot:

    https://vita.had.co.nz/papers/letter-value-plot.html

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {width}
    {dodge}
    k_depth : "proportion" | "tukey" | "trustworthy", optional
        The number of boxes, and by extension number of percentiles, to draw.
        All methods are detailed in Wickham's paper. Each makes different
        assumptions about the number of outliers and leverages different
        statistical properties.
    {linewidth}
    scale : "linear" | "exponential" | "area"
        Method to use for the width of the letter value boxes. All give similar
        results visually. "linear" reduces the width by a constant linear
        factor, "exponential" uses the proportion of data not covered, "area"
        is proportional to the percentage of data covered.
    outlier_prop : float, optional
        Proportion of data believed to be outliers. Used in conjunction with
        k_depth to determine the number of percentiles to draw. Defaults to
        0.007 as a proportion of outliers. Should be in range [0, 1].
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to ``plt.plot`` and
        ``plt.scatter`` at draw time.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {violinplot}
    {boxplot}

    Examples
    --------

    Draw a single horizontal boxen plot:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.boxenplot(x=tips["total_bill"])

    Draw a vertical boxen plot grouped by a categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxenplot(x="day", y="total_bill", data=tips)

    Draw a letter value plot with nested grouping by two categorical variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxenplot(x="day", y="total_bill", hue="smoker",
        ...                    data=tips, palette="Set3")

    Draw a boxen plot with nested grouping when some bins are empty:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxenplot(x="day", y="total_bill", hue="time",
        ...                    data=tips, linewidth=2.5)

    Control box order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxenplot(x="time", y="tip", data=tips,
        ...                    order=["Dinner", "Lunch"])

    Draw a boxen plot for each numeric variable in a DataFrame:

    .. plot::
        :context: close-figs

        >>> iris = sns.load_dataset("iris")
        >>> ax = sns.boxenplot(data=iris, orient="h", palette="Set2")

    Use :func:`stripplot` to show the datapoints on top of the boxes:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxenplot(x="day", y="total_bill", data=tips)
        >>> ax = sns.stripplot(x="day", y="total_bill", data=tips,
        ...                    size=4, jitter=True, color="gray")

    Use :func:`catplot` to combine :func:`boxenplot` and a :class:`FacetGrid`.
    This allows grouping within additional categorical variables. Using
    :func:`catplot` is safer than using :class:`FacetGrid` directly, as it
    ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="boxen",
        ...                 height=4, aspect=.7);

    Rr   i    c         K   s  d | k r4 | j  d  } d } t j | t  n  t |  | | | | | | | | |	 |
  } | d  k ry t j   } n  | j d d  | j	 d |  } | d  k r | d } n  | d k r | j
 } n  | j t d | d d	 | d
 |   | j | |  | S(   NR   s2   The `split` parameter has been renamed to `dodge`.R   i   RN   i
   Rr   i   R   R   (   R   R  R  R  RF  R"   R   R  R  R5   Rr   R   Rk   R   (   RC   RD   RE   RF   RG   RH   RJ  R   R9   Rs   Rt   R   R   R   R   R  R   R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   
  s&    
sK      Draw a scatterplot where one variable is categorical.

    A strip plot can be drawn on its own, but it is also a good complement
    to a box or violin plot in cases where you want to show all observations
    along with some representation of the underlying distribution.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    jitter : float, ``True``/``1`` is special-cased, optional
        Amount of jitter (only along the categorical axis) to apply. This
        can be useful when you have many points and they overlap, so that
        it is easier to see the distribution. You can specify the amount
        of jitter (half the width of the uniform random variable support),
        or just use ``True`` for a good default.
    dodge : bool, optional
        When using ``hue`` nesting, setting this to ``True`` will separate
        the strips for different hue levels along the categorical axis.
        Otherwise, the points for each level will be plotted on top of
        each other.
    {orient}
    {color}
    {palette}
    size : float, optional
        Diameter of the markers, in points. (Although ``plt.scatter`` is used
        to draw the points, the ``size`` argument here takes a "normal"
        markersize and not size^2 like ``plt.scatter``.
    edgecolor : matplotlib color, "gray" is special-cased, optional
        Color of the lines around each point. If you pass ``"gray"``, the
        brightness is determined by the color palette used for the body
        of the points.
    {linewidth}
    {ax_in}

    Returns
    -------
    {ax_out}

    See Also
    --------
    {swarmplot}
    {boxplot}
    {violinplot}

    Examples
    --------

    Draw a single horizontal strip plot:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.stripplot(x=tips["total_bill"])

    Group the strips by a categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="day", y="total_bill", data=tips)

    Add jitter to bring out the distribution of values:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="day", y="total_bill", data=tips, jitter=True)

    Use a smaller amount of jitter:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="day", y="total_bill", data=tips, jitter=0.05)

    Draw horizontal strips:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="total_bill", y="day", data=tips,
        ...                    jitter=True)

    Draw outlines around the points:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="total_bill", y="day", data=tips,
        ...                    jitter=True, linewidth=1)

    Nest the strips within a second categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="sex", y="total_bill", hue="day",
        ...                    data=tips, jitter=True)

    Draw each level of the ``hue`` variable at different locations on the
    major categorical axis:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="day", y="total_bill", hue="smoker",
        ...                    data=tips, jitter=True,
        ...                    palette="Set2", dodge=True)

    Control strip order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.stripplot(x="time", y="tip", data=tips,
        ...                    order=["Dinner", "Lunch"])

    Draw strips with large points and different aesthetics:

    .. plot::
        :context: close-figs

        >>> ax =  sns.stripplot("day", "total_bill", "smoker", data=tips,
        ...                    palette="Set2", size=20, marker="D",
        ...                    edgecolor="gray", alpha=.25)

    Draw strips of observations on top of a box plot:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="tip", y="day", data=tips, whis=np.inf)
        >>> ax = sns.stripplot(x="tip", y="day", data=tips,
        ...                    jitter=True, color=".3")

    Draw strips of observations on top of a violin plot:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", data=tips,
        ...                     inner=None, color=".8")
        >>> ax = sns.stripplot(x="day", y="total_bill", data=tips, jitter=True)

    Use :func:`catplot` to combine a :func:`stripplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="strip",
        ...                 jitter=True,
        ...                 height=4, aspect=.7);

    c         K   s  d | k r4 | j  d  } d } t j | t  n  t |  | | | | | | | | |	 
 } | d  k rv t j   } n  | j d d  | j	 d |
  }
 | d  k r |
 d } n  | d k r | j
 } n  | j t d |
 d d	 | d
 |   | j | |  | S(   NR   s2   The `split` parameter has been renamed to `dodge`.R   i   RN   i
   Rr   i   R   R   (   R   R  R  R  RQ  R"   R   R  R  R5   Rr   R   Rk   R   (   RC   RD   RE   RF   RG   RH   R   R9   Rs   Rt   R   R   R   R   R  R   R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s&    
s      Draw a categorical scatterplot with non-overlapping points.

    This function is similar to :func:`stripplot`, but the points are adjusted
    (only along the categorical axis) so that they don't overlap. This gives a
    better representation of the distribution of values, but it does not scale
    well to large numbers of observations. This style of plot is sometimes
    called a "beeswarm".

    A swarm plot can be drawn on its own, but it is also a good complement
    to a box or violin plot in cases where you want to show all observations
    along with some representation of the underlying distribution.

    Arranging the points properly requires an accurate transformation between
    data and point coordinates. This means that non-default axis limits must
    be set *before* drawing the plot.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    dodge : bool, optional
        When using ``hue`` nesting, setting this to ``True`` will separate
        the strips for different hue levels along the categorical axis.
        Otherwise, the points for each level will be plotted in one swarm.
    {orient}
    {color}
    {palette}
    size : float, optional
        Diameter of the markers, in points. (Although ``plt.scatter`` is used
        to draw the points, the ``size`` argument here takes a "normal"
        markersize and not size^2 like ``plt.scatter``.
    edgecolor : matplotlib color, "gray" is special-cased, optional
        Color of the lines around each point. If you pass ``"gray"``, the
        brightness is determined by the color palette used for the body
        of the points.
    {linewidth}
    {ax_in}

    Returns
    -------
    {ax_out}

    See Also
    --------
    {boxplot}
    {violinplot}
    {stripplot}
    {catplot}

    Examples
    --------

    Draw a single horizontal swarm plot:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.swarmplot(x=tips["total_bill"])

    Group the swarms by a categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="day", y="total_bill", data=tips)

    Draw horizontal swarms:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="total_bill", y="day", data=tips)

    Color the points using a second categorical variable:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="day", y="total_bill", hue="sex", data=tips)

    Split each level of the ``hue`` variable along the categorical axis:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="day", y="total_bill", hue="smoker",
        ...                    data=tips, palette="Set2", dodge=True)

    Control swarm order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="time", y="tip", data=tips,
        ...                    order=["Dinner", "Lunch"])

    Plot using larger points:

    .. plot::
        :context: close-figs

        >>> ax = sns.swarmplot(x="time", y="tip", data=tips, size=6)

    Draw swarms of observations on top of a box plot:

    .. plot::
        :context: close-figs

        >>> ax = sns.boxplot(x="tip", y="day", data=tips, whis=np.inf)
        >>> ax = sns.swarmplot(x="tip", y="day", data=tips, color=".2")

    Draw swarms of observations on top of a violin plot:

    .. plot::
        :context: close-figs

        >>> ax = sns.violinplot(x="day", y="total_bill", data=tips, inner=None)
        >>> ax = sns.swarmplot(x="day", y="total_bill", data=tips,
        ...                    color="white", edgecolor="gray")

    Use :func:`catplot` to combine a :func:`swarmplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="swarm",
        ...                 height=4, aspect=.7);

    i_   i  s   .26c         K   sn   t  |  | | | | | | | | |	 |
 | | | | | | |  } | d  k rZ t j   } n  | j | |  | S(   N(   R  R"   R   R  R   (   RC   RD   RE   RF   RG   RH   R  R  R  RI   R9   Rs   Rt   Ru   R  R  R  R   R   R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   D  s    s}      Show point estimates and confidence intervals as rectangular bars.

    A bar plot represents an estimate of central tendency for a numeric
    variable with the height of each rectangle and provides some indication of
    the uncertainty around that estimate using error bars. Bar plots include 0
    in the quantitative axis range, and they are a good choice when 0 is a
    meaningful value for the quantitative variable, and you want to make
    comparisons against it.

    For datasets where 0 is not a meaningful value, a point plot will allow you
    to focus on differences between levels of one or more categorical
    variables.

    It is also important to keep in mind that a bar plot shows only the mean
    (or other estimator) value, but in many cases it may be more informative to
    show the distribution of values at each level of the categorical variables.
    In that case, other approaches such as a box or violin plot may be more
    appropriate.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    {stat_api_params}
    {orient}
    {color}
    {palette}
    {saturation}
    errcolor : matplotlib color
        Color for the lines that represent the confidence interval.
    {errwidth}
    {capsize}
    {dodge}
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed through to ``plt.bar`` at draw
        time.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {countplot}
    {pointplot}
    {catplot}

    Examples
    --------

    Draw a set of vertical bar plots grouped by a categorical variable:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="whitegrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.barplot(x="day", y="total_bill", data=tips)

    Draw a set of vertical bars with nested grouping by a two variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="day", y="total_bill", hue="sex", data=tips)

    Draw a set of horizontal bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="tip", y="day", data=tips)

    Control bar order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="time", y="tip", data=tips,
        ...                  order=["Dinner", "Lunch"])

    Use median as the estimate of central tendency:

    .. plot::
        :context: close-figs

        >>> from numpy import median
        >>> ax = sns.barplot(x="day", y="tip", data=tips, estimator=median)

    Show the standard error of the mean with the error bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="day", y="tip", data=tips, ci=68)

    Show standard deviation of observations instead of a confidence interval:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="day", y="tip", data=tips, ci="sd")

    Add "caps" to the error bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot(x="day", y="tip", data=tips, capsize=.2)

    Use a different color palette for the bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot("size", y="total_bill", data=tips,
        ...                  palette="Blues_d")

    Use ``hue`` without changing bar position or width:

    .. plot::
        :context: close-figs

        >>> tips["weekend"] = tips["day"].isin(["Sat", "Sun"])
        >>> ax = sns.barplot(x="day", y="total_bill", hue="weekend",
        ...                  data=tips, dodge=False)

    Plot all bars in a single color:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot("size", y="total_bill", data=tips,
        ...                  color="salmon", saturation=.5)

    Use ``plt.bar`` keyword arguments to further change the aesthetic:

    .. plot::
        :context: close-figs

        >>> ax = sns.barplot("day", "total_bill", data=tips,
        ...                  linewidth=2.5, facecolor=(1, 1, 1, 0),
        ...                  errcolor=".2", edgecolor=".2")

    Use :func:`catplot` to combine a :func:`barplot` and a :class:`FacetGrid`.
    This allows grouping within additional categorical variables. Using
    :func:`catplot` is safer than using :class:`FacetGrid` directly, as it
    ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="bar",
        ...                 height=4, aspect=.7);

    t   oR   c         K   sq   t  |  | | | | | | | | |	 |
 | | | | | | | | |  } | d  k r` t j   } n  | j |  | S(   N(   R  R"   R   R  R   (   RC   RD   RE   RF   RG   RH   R  R  R  RI   R  R  R   R  R   R9   Rs   Rt   R  R  R   R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s    sy      Show point estimates and confidence intervals using scatter plot glyphs.

    A point plot represents an estimate of central tendency for a numeric
    variable by the position of scatter plot points and provides some
    indication of the uncertainty around that estimate using error bars.

    Point plots can be more useful than bar plots for focusing comparisons
    between different levels of one or more categorical variables. They are
    particularly adept at showing interactions: how the relationship between
    levels of one categorical variable changes across levels of a second
    categorical variable. The lines that join each point from the same ``hue``
    level allow interactions to be judged by differences in slope, which is
    easier for the eyes than comparing the heights of several groups of points
    or bars.

    It is important to keep in mind that a point plot shows only the mean (or
    other estimator) value, but in many cases it may be more informative to
    show the distribution of values at each level of the categorical variables.
    In that case, other approaches such as a box or violin plot may be more
    appropriate.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    {stat_api_params}
    markers : string or list of strings, optional
        Markers to use for each of the ``hue`` levels.
    linestyles : string or list of strings, optional
        Line styles to use for each of the ``hue`` levels.
    dodge : bool or float, optional
        Amount to separate the points for each level of the ``hue`` variable
        along the categorical axis.
    join : bool, optional
        If ``True``, lines will be drawn between point estimates at the same
        ``hue`` level.
    scale : float, optional
        Scale factor for the plot elements.
    {orient}
    {color}
    {palette}
    {errwidth}
    {capsize}
    {ax_in}

    Returns
    -------
    {ax_out}

    See Also
    --------
    {barplot}
    {catplot}

    Examples
    --------

    Draw a set of vertical point plots grouped by a categorical variable:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="darkgrid")
        >>> tips = sns.load_dataset("tips")
        >>> ax = sns.pointplot(x="time", y="total_bill", data=tips)

    Draw a set of vertical points with nested grouping by a two variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="time", y="total_bill", hue="smoker",
        ...                    data=tips)

    Separate the points for different hue levels along the categorical axis:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="time", y="total_bill", hue="smoker",
        ...                    data=tips, dodge=True)

    Use a different marker and line style for the hue levels:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="time", y="total_bill", hue="smoker",
        ...                    data=tips,
        ...                    markers=["o", "x"],
        ...                    linestyles=["-", "--"])

    Draw a set of horizontal points:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="tip", y="day", data=tips)

    Don't draw a line connecting each point:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="tip", y="day", data=tips, join=False)

    Use a different color for a single-layer plot:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot("time", y="total_bill", data=tips,
        ...                    color="#bb3f3f")

    Use a different color palette for the points:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="time", y="total_bill", hue="smoker",
        ...                    data=tips, palette="Set2")

    Control point order by passing an explicit order:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="time", y="tip", data=tips,
        ...                    order=["Dinner", "Lunch"])

    Use median as the estimate of central tendency:

    .. plot::
        :context: close-figs

        >>> from numpy import median
        >>> ax = sns.pointplot(x="day", y="tip", data=tips, estimator=median)

    Show the standard error of the mean with the error bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="day", y="tip", data=tips, ci=68)

    Show standard deviation of observations instead of a confidence interval:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="day", y="tip", data=tips, ci="sd")

    Add "caps" to the error bars:

    .. plot::
        :context: close-figs

        >>> ax = sns.pointplot(x="day", y="tip", data=tips, capsize=.2)

    Use :func:`catplot` to combine a :func:`barplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="sex", y="total_bill",
        ...                 hue="smoker", col="time",
        ...                 data=tips, kind="point",
        ...                 dodge=True,
        ...                 height=4, aspect=.7);

    c         K   s"  t  } d  } d } d  } d  } d  } d  } |  d  k rQ | d  k	 rQ d } | }  nZ | d  k rx |  d  k	 rx d } |  } n3 |  d  k	 r | d  k	 r t d   n t d   t |  | | | | | | | | | | | | |	 | | | |
  } d | _ | d  k rt j   } n  | j | |  | S(   Ni    R   R    s'   Cannot pass values for both `x` and `y`s&   Must pass values for either `x` or `y`R   (   R/   R"   R   R  R<   R   R  R   (   RC   RD   RE   RF   RG   RH   R9   Rs   Rt   Ru   R   R   R  R  R  R  RI   R  R  R  R  (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR     s2    			s	      Show the counts of observations in each categorical bin using bars.

    A count plot can be thought of as a histogram across a categorical, instead
    of quantitative, variable. The basic API and options are identical to those
    for :func:`barplot`, so you can compare counts across nested variables.

    {main_api_narrative}

    {categorical_narrative}

    Parameters
    ----------
    {input_params}
    {categorical_data}
    {order_vars}
    {orient}
    {color}
    {palette}
    {saturation}
    {dodge}
    {ax_in}
    kwargs : key, value mappings
        Other keyword arguments are passed to ``plt.bar``.

    Returns
    -------
    {ax_out}

    See Also
    --------
    {barplot}
    {catplot}

    Examples
    --------

    Show value counts for a single categorical variable:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="darkgrid")
        >>> titanic = sns.load_dataset("titanic")
        >>> ax = sns.countplot(x="class", data=titanic)

    Show value counts for two categorical variables:

    .. plot::
        :context: close-figs

        >>> ax = sns.countplot(x="class", hue="who", data=titanic)

    Plot the bars horizontally:

    .. plot::
        :context: close-figs

        >>> ax = sns.countplot(y="class", hue="who", data=titanic)

    Use a different color palette:

    .. plot::
        :context: close-figs

        >>> ax = sns.countplot(x="who", data=titanic, palette="Set3")

    Use ``plt.bar`` keyword arguments for a different look:

    .. plot::
        :context: close-figs

        >>> ax = sns.countplot(x="who", data=titanic,
        ...                    facecolor=(0, 0, 0, 0),
        ...                    linewidth=5,
        ...                    edgecolor=sns.color_palette("dark", 3))

    Use :func:`catplot` to combine a :func:`countplot` and a
    :class:`FacetGrid`. This allows grouping within additional categorical
    variables. Using :func:`catplot` is safer than using :class:`FacetGrid`
    directly, as it ensures synchronization of variable order across facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="class", hue="who", col="survived",
        ...                 data=titanic, kind="count",
        ...                 height=4, aspect=.7);

    c          O   sh   d } t  j |  d | k rK | j d  | d <d } t  j | t  n  | j d d  t |  |   S(   s)   Deprecated; please use `catplot` instead.s   The `factorplot` function has been renamed to `catplot`. The original name will be removed in a future release. Please update your code. Note that the default `kind` in `factorplot` (`'point'`) has changed `'strip'` in `catplot`.R   R  sJ   The `size` paramter has been renamed to `height`; please update your code.t   kindR   (   R  R  R   R  R  R   (   R  R  R   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   I  s    t   stripc   $      K   s  d | k r4 | j  d  } d } t j | t  n  y t   | d } Wn, t k
 rw d j |  } t |   n X| d k r |  d  k r | d  k	 r | | d } }  } q | d  k r |  d  k	 r |  |  d } }  } q t d   n |  | } }  t	   }! |! j
 | |  | | | | |  |! j } |! j } |! j | | d	  | d
 k sc| d  k	 ro|! j } n  | d  k ri  n | } | j d | d | d | d | d | d | d | d | d | d | d | d | d t  t d | d | d | d | d |  }" |" j |  | d& k rD|" j d | d | d  |	 d! |
  n  t |   }# |# j | |  | | |"  | d k r|  d  k r|# j d" d  n  | d  k r|# j d# d  qn  | r| d  k	 r| |  | | g k rt t t j |   } |# j d$ | d% |  n  |# S('   NR   sJ   The `size` paramter has been renamed to `height`; please update your code.R   s    Plot kind '{}' is not recognizedR   R   R    s.   Either `x` or `y` must be None for count plotsi   R   RF   t   rowRK   t	   row_ordert	   col_ordert   col_wrapR  t   aspectt   sharext   shareyt
   legend_outt   margin_titlest   dropnaRG   RH   R9   Rs   Rt   R  R  R  R  RI   t   x_vart   y_vart   titlet   label_order(   R  R   (   R   R  R  R  t   globalsR\   R6   R#   R"   R   RX   R=   R@   R|   Rp   R   R   Rk   R   t   map_dataframet   set_axis_labelsR1   t   mapR   t   to_utf8t
   add_legend($   RC   RD   RE   RF   R  RK   R  R  R  R  RI   RG   RH   R  R  R
  R  R  R9   Rs   Rt   R   R  R  R  R  t	   facet_kwsR  R   t	   plot_funcRT   t   x_t   y_R  t   plot_kwsRa   (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyR   _  sb    						's      Figure-level interface for drawing categorical plots onto a FacetGrid.

    This function provides access to several axes-level functions that
    show the relationship between a numerical and one or more categorical
    variables using one of several visual representations. The ``kind``
    parameter selects the underlying axes-level function to use:

    Categorical scatterplots:

    - :func:`stripplot` (with ``kind="strip"``; the default)
    - :func:`swarmplot` (with ``kind="swarm"``)

    Categorical distribution plots:

    - :func:`boxplot` (with ``kind="box"``)
    - :func:`violinplot` (with ``kind="violin"``)
    - :func:`boxenplot` (with ``kind="boxen"``)

    Categorical estimate plots:

    - :func:`pointplot` (with ``kind="point"``)
    - :func:`barplot` (with ``kind="bar"``)
    - :func:`countplot` (with ``kind="count"``)

    Extra keyword arguments are passed to the underlying function, so you
    should refer to the documentation for each to see kind-specific options.

    Note that unlike when using the axes-level functions directly, data must be
    passed in a long-form DataFrame with variables specified by passing strings
    to ``x``, ``y``, ``hue``, etc.

    As in the case with the underlying plot functions, if variables have a
    ``categorical`` data type, the the levels of the categorical variables, and
    their order will be inferred from the objects. Otherwise you may have to
    use alter the dataframe sorting or use the function parameters (``orient``,
    ``order``, ``hue_order``, etc.) to set up the plot correctly.

    {categorical_narrative}

    After plotting, the :class:`FacetGrid` with the plot is returned and can
    be used directly to tweak supporting plot details or add other layers.

    Parameters
    ----------
    {string_input_params}
    {long_form_data}
    row, col : names of variables in ``data``, optional
        Categorical variables that will determine the faceting of the grid.
    {col_wrap}
    {stat_api_params}
    {order_vars}
    row_order, col_order : lists of strings, optional
        Order to organize the rows and/or columns of the grid in, otherwise the
        orders are inferred from the data objects.
    kind : string, optional
        The kind of plot to draw (corresponds to the name of a categorical
        plotting function. Options are: "point", "bar", "strip", "swarm",
        "box", "violin", or "boxen".
    {height}
    {aspect}
    {orient}
    {color}
    {palette}
    legend : bool, optional
        If ``True`` and there is a ``hue`` variable, draw a legend on the plot.
    {legend_out}
    {share_xy}
    {margin_titles}
    facet_kws : dict, optional
        Dictionary of other keyword arguments to pass to :class:`FacetGrid`.
    kwargs : key, value pairings
        Other keyword arguments are passed through to the underlying plotting
        function.

    Returns
    -------
    g : :class:`FacetGrid`
        Returns the :class:`FacetGrid` object with the plot on it for further
        tweaking.

    Examples
    --------

    Draw a single facet to use the :class:`FacetGrid` legend placement:

    .. plot::
        :context: close-figs

        >>> import seaborn as sns
        >>> sns.set(style="ticks")
        >>> exercise = sns.load_dataset("exercise")
        >>> g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise)

    Use a different plot kind to visualize the same data:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="time", y="pulse", hue="kind",
        ...                data=exercise, kind="violin")

    Facet along the columns to show a third categorical variable:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="time", y="pulse", hue="kind",
        ...                 col="diet", data=exercise)

    Use a different height and aspect ratio for the facets:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="time", y="pulse", hue="kind",
        ...                 col="diet", data=exercise,
        ...                 height=5, aspect=.8)

    Make many column facets and wrap them into the rows of the grid:

    .. plot::
        :context: close-figs

        >>> titanic = sns.load_dataset("titanic")
        >>> g = sns.catplot("alive", col="deck", col_wrap=4,
        ...                 data=titanic[titanic.deck.notnull()],
        ...                 kind="count", height=2.5, aspect=.8)

    Plot horizontally and pass other keyword arguments to the plot function:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="age", y="embark_town",
        ...                 hue="sex", row="class",
        ...                 data=titanic[titanic.embark_town.notnull()],
        ...                 orient="h", height=2, aspect=3, palette="Set3",
        ...                 kind="violin", dodge=True, cut=0, bw=.2)

    Use methods on the returned :class:`FacetGrid` to tweak the presentation:

    .. plot::
        :context: close-figs

        >>> g = sns.catplot(x="who", y="survived", col="class",
        ...                 data=titanic, saturation=.5,
        ...                 kind="bar", ci=None, aspect=.6)
        >>> (g.set_axis_labels("", "Survival Rate")
        ...   .set_xticklabels(["Men", "Women", "Children"])
        ...   .set_titles("{{col_name}} {{col_var}}")
        ...   .set(ylim=(0, 1))
        ...   .despine(left=True))  #doctest: +ELLIPSIS
        <seaborn.axisgrid.FacetGrid object at 0x...>

    (I   t
   __future__R    t   textwrapR   Rl   t   numpyR(   t   scipyR   t   pandasR%   t
   matplotlibRo   t   matplotlib.collectionsR   t   matplotlib.patchest   patchesR  t   matplotlib.pyplott   pyplotR   R  t   external.sixR   t   external.six.movesR   t    R   R   R   R	   t
   algorithmsR
   t   palettesR   R   R   R   t   axisgridR   R   t   __all__t   objectR   R   R   R>  RF  RQ  R  R  R  R  Rk   t   _categorical_docsR   R"   R   R   R   R6   RP  R   R   R   R   R   R   R   R   R   R   R   (    (    (    s2   lib/python2.7/site-packages/seaborn/categorical.pyt   <module>   s.  " s   )GE																												#Z		V