σ
ίΘ[c           @` sd   d  d l  m Z m Z m Z d  d l Z d d l m Z d d l m	 Z	 d g Z
 d d d  Z d S(	   i    (   t   absolute_importt   divisiont   unicode_literalsNi   (   t	   histogram(   t	   signatureu   histi
   c         ` s   t  t t j  j j    d } t   f d   | D  } t |  | |  \ } } | d k r d d l j	 } | j
   } n  | j |  |    S(   u  Enhanced histogram function

    This is a histogram function that enables the use of more sophisticated
    algorithms for determining bins.  Aside from the ``bins`` argument allowing
    a string specified how bins are computed, the parameters are the same
    as pylab.hist().

    This function was ported from astroML: http://astroML.org/

    Parameters
    ----------
    x : array_like
        array of data to be histogrammed

    bins : int or list or str (optional)
        If bins is a string, then it must be one of:

        - 'blocks' : use bayesian blocks for dynamic bin widths

        - 'knuth' : use Knuth's rule to determine bins

        - 'scott' : use Scott's rule to determine bins

        - 'freedman' : use the Freedman-diaconis rule to determine bins

    ax : Axes instance (optional)
        specify the Axes on which to draw the histogram.  If not specified,
        then the current active axes will be used.

    **kwargs :
        other keyword arguments are described in ``plt.hist()``.

    Notes
    -----
    Return values are the same as for ``plt.hist()``

    See Also
    --------
    astropy.stats.histogram
    i   c         3` s+   |  ]! } |   k r |   | f Vq d  S(   N(    (   t   .0t   key(   t   kwargs(    s9   lib/python2.7/site-packages/astropy/visualization/hist.pys	   <genexpr>7   s    i    N(   t   listR   t   npR   t
   parameterst   keyst   dictt   Nonet   matplotlib.pyplott   pyplott   gcat   hist(   t   xt   binst   axR   t   arglistt   np_hist_kwdsR   t   plt(    (   R   s9   lib/python2.7/site-packages/astropy/visualization/hist.pyR      s    *"(   t
   __future__R    R   R   t   numpyR	   t   statsR   t   utils.compat.funcsigsR   t   __all__R   R   (    (    (    s9   lib/python2.7/site-packages/astropy/visualization/hist.pyt   <module>   s
   	