ó
mÜJ]c           @` sG  d  d l  m Z m Z m Z m Z d  d l Z e j e ƒ Z d  d l	 m
 Z
 d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d d l m Z m Z m Z d d l m Z m Z m Z m Z m Z d d l m  Z! d d	 l m" Z# d d
 l$ m% Z% m& Z& m' Z' m( Z( d d l) m* Z* d d l+ m, Z, d d l- m. Z. m/ Z/ m0 Z0 m1 Z1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 d Z7 d d d d f Z8 d e f d „  ƒ  YZ9 d „  Z: e9 j; e: _; i d d 6d d 6d d 6d d 6d d  6d! d" 6d# d$ 6d% d& 6Z< d' „  Z" d( e* f d) „  ƒ  YZ= e> d* d+ d, g ƒ Z? e> d- d. d/ g ƒ Z@ d S(0   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   string_typesi   (
   t   Anyt   Autot   Eithert   Enumt   Intt   Listt   Seqt   Instancet   Stringt   Tuple(   t   HorizontalLocationt
   MarkerTypet   VerticalLocation(   t   ColumnDataSourcet   Plott   Titlet   Toolt   GraphRenderer(   t   glyphs(   t   markers(   t   Dragt
   Inspectiont   Scrollt   Tap(   t   Options(   t   linear_cmapi   (	   t
   _get_ranget
   _get_scalet   _process_axis_and_gridt   _process_tools_argt   _glyph_functiont   _process_active_toolst   _single_stackt   _double_stackt   _graphu'   pan,wheel_zoom,box_zoom,save,reset,helpu   Figureu   figureu   FigureOptionsu   markerst   Figurec           B` s€  e  Z d  Z d Z d Z d „  Z e e j ƒ Z	 e e j
 d ƒ Z e e j ƒ Z e e j d ƒ Z e e j ƒ Z e e j d ƒ Z e e j d ƒ Z e e j d ƒ Z e e j d	 ƒ Z e e j d
 ƒ Z e e j d ƒ Z e e j d ƒ Z  e e j! d ƒ Z" e e j# d ƒ Z$ e e j% d ƒ Z& e e j' d ƒ Z( e e j) d ƒ Z* e e j+ d ƒ Z, e e j- d ƒ Z. e e j/ ƒ Z0 e e j1 d ƒ Z2 e e j3 d ƒ Z4 e e j5 d ƒ Z6 e e j7 d ƒ Z8 e e j9 d ƒ Z: e e j; d ƒ Z< e e j= d ƒ Z> e e j? d ƒ Z@ e e jA ƒ ZB e e jC d ƒ ZD e e jE d ƒ ZF e e jG d ƒ ZH e e jI d ƒ ZJ e e jK d  ƒ ZL e e jM d! ƒ ZN e e jO d" ƒ ZP e e jQ d# ƒ ZR e e jS d$ ƒ ZT e e jU d% ƒ ZV e e jW d& ƒ ZX e e jY d' ƒ ZZ e e j[ d( ƒ Z\ e e j] ƒ Z^ d) „  Z_ d* d+ d6 d6 d, d- „ Za d. „  Zb d/ „  Zc d0 „  Zd d1 „  Ze d2 „  Zf d3 „  Zg d4 „  Zh d5 „  Zi RS(7   uš   Create a new Figure for plotting.

    A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot
    creation with default axes, grids, tools, etc.

    Figure objects have many glyph methods that can be used to draw
    vectorized graphical glyphs:

    .. hlist::
        :columns: 3

        * :func:`~bokeh.plotting.figure.Figure.annular_wedge`
        * :func:`~bokeh.plotting.figure.Figure.annulus`
        * :func:`~bokeh.plotting.figure.Figure.arc`
        * :func:`~bokeh.plotting.figure.Figure.asterisk`
        * :func:`~bokeh.plotting.figure.Figure.bezier`
        * :func:`~bokeh.plotting.figure.Figure.circle`
        * :func:`~bokeh.plotting.figure.Figure.circle_cross`
        * :func:`~bokeh.plotting.figure.Figure.circle_x`
        * :func:`~bokeh.plotting.figure.Figure.cross`
        * :func:`~bokeh.plotting.figure.Figure.dash`
        * :func:`~bokeh.plotting.figure.Figure.diamond`
        * :func:`~bokeh.plotting.figure.Figure.diamond_cross`
        * :func:`~bokeh.plotting.figure.Figure.ellipse`
        * :func:`~bokeh.plotting.figure.Figure.harea`
        * :func:`~bokeh.plotting.figure.Figure.hbar`
        * :func:`~bokeh.plotting.figure.Figure.hex`
        * :func:`~bokeh.plotting.figure.Figure.hex_tile`
        * :func:`~bokeh.plotting.figure.Figure.image`
        * :func:`~bokeh.plotting.figure.Figure.image_rgba`
        * :func:`~bokeh.plotting.figure.Figure.image_url`
        * :func:`~bokeh.plotting.figure.Figure.inverted_triangle`
        * :func:`~bokeh.plotting.figure.Figure.line`
        * :func:`~bokeh.plotting.figure.Figure.multi_line`
        * :func:`~bokeh.plotting.figure.Figure.multi_polygons`
        * :func:`~bokeh.plotting.figure.Figure.oval`
        * :func:`~bokeh.plotting.figure.Figure.patch`
        * :func:`~bokeh.plotting.figure.Figure.patches`
        * :func:`~bokeh.plotting.figure.Figure.quad`
        * :func:`~bokeh.plotting.figure.Figure.quadratic`
        * :func:`~bokeh.plotting.figure.Figure.ray`
        * :func:`~bokeh.plotting.figure.Figure.rect`
        * :func:`~bokeh.plotting.figure.Figure.segment`
        * :func:`~bokeh.plotting.figure.Figure.square`
        * :func:`~bokeh.plotting.figure.Figure.square_cross`
        * :func:`~bokeh.plotting.figure.Figure.square_x`
        * :func:`~bokeh.plotting.figure.Figure.step`
        * :func:`~bokeh.plotting.figure.Figure.text`
        * :func:`~bokeh.plotting.figure.Figure.triangle`
        * :func:`~bokeh.plotting.figure.Figure.varea`
        * :func:`~bokeh.plotting.figure.Figure.vbar`
        * :func:`~bokeh.plotting.figure.Figure.wedge`
        * :func:`~bokeh.plotting.figure.Figure.x`

    There is a scatter function that can be parameterized by marker type:

    * :func:`~bokeh.plotting.figure.Figure.scatter`

    There are also specialized methods for stacking bars:

    * bars: :func:`~bokeh.plotting.figure.Figure.hbar_stack`, :func:`~bokeh.plotting.figure.Figure.vbar_stack`
    * lines: :func:`~bokeh.plotting.figure.Figure.hline_stack`, :func:`~bokeh.plotting.figure.Figure.vline_stack`
    * areas: :func:`~bokeh.plotting.figure.Figure.harea_stack`, :func:`~bokeh.plotting.figure.Figure.varea_stack`

    As well as one specialized method for making simple hexbin plots:

    * :func:`~bokeh.plotting.figure.Figure.hexbin`

    In addition to all the ``Figure`` property attributes, the following
    options are also accepted:

    .. bokeh-options:: FigureOptions
        :module: bokeh.plotting.figure

    u   Figureu   Plotc         O` sï  d | k r' d | k r' t  d ƒ ‚ n  d | k rN d | k rN t  d ƒ ‚ n  d | k rp | j d ƒ | d <n  d | k r’ | j d ƒ | d <n  t | ƒ } | j d d  ƒ } t | t ƒ rÕ t d | ƒ | d <n  t t	 |  ƒ j
 | | Ž  t | j ƒ |  _ t | j ƒ |  _ t |  j | j ƒ |  _ t |  j | j ƒ |  _ t |  | j | j | j | j |  j d	 ƒ t |  | j | j | j | j |  j d
 ƒ t |  | j | j ƒ \ } } |  j | Œ  t |  j | | j  | j! | j" | j# ƒ d  S(   Nu
   plot_widthu   widthuJ   Figure called with both 'plot_width' and 'width' supplied, supply only oneu   plot_heightu   heightuL   Figure called with both 'plot_height' and 'height' supplied, supply only oneu   titlet   texti    i   ($   t
   ValueErrort   popt   FigureOptionst   gett   Nonet
   isinstanceR   R   t   superR(   t   __init__R   t   x_ranget   y_rangeR    t   x_axis_typet   x_scalet   y_axis_typet   y_scaleR!   t   x_axis_locationt   x_minor_tickst   x_axis_labelt   y_axis_locationt   y_minor_tickst   y_axis_labelR"   t   toolst   tooltipst	   add_toolsR$   t   toolbart   active_dragt   active_inspectt   active_scrollt
   active_tap(   t   selft   argt   kwt   optst   titlet	   tool_objst   tool_map(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyR1   ˆ   s,    ++ud  
Examples:

        .. bokeh-plot::
            :source-position: above

            from bokeh.plotting import figure, output_file, show

            plot = figure(plot_width=300, plot_height=300)
            plot.annulus(x=[1, 2, 3], y=[1, 2, 3], color="#7FC97F",
                         inner_radius=0.2, outer_radius=0.5)

            show(plot)

    u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.asterisk(x=[1,2,3], y=[1,2,3], size=20, color="#F0027F")

        show(plot)

uy  
.. note::
    Only one of ``size`` or ``radius`` should be provided. Note that ``radius``
    defaults to data units.

Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.circle(x=[1, 2, 3], y=[1, 2, 3], size=20)

        show(plot)

uM  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.circle_cross(x=[1,2,3], y=[4,5,6], size=20,
                          color="#FB8072", fill_alpha=0.2, line_width=2)

        show(plot)

u:  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.circle_x(x=[1, 2, 3], y=[1, 2, 3], size=20,
                     color="#DD1C77", fill_alpha=0.2)

        show(plot)

u3  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.cross(x=[1, 2, 3], y=[1, 2, 3], size=20,
                   color="#E6550D", line_width=2)

        show(plot)

u9  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.dash(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                  color="#99D594", line_width=2)

        show(plot)

u6  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.diamond(x=[1, 2, 3], y=[1, 2, 3], size=20,
                    color="#1C9099", line_width=2)

        show(plot)

uT  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.diamond_cross(x=[1, 2, 3], y=[1, 2, 3], size=20,
                           color="#386CB0", fill_color=None, line_width=2)

        show(plot)

u:  
    Examples:

   .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.harea(x1=[0, 0, 0], x2=[1, 4, 2], y=[1, 2, 3],
                      fill_color="#99D594")

        show(plot)

    u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.hbar(y=[1, 2, 3], height=0.5, left=0, right=[1,2,3], color="#CAB2D6")

        show(plot)
uT  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.ellipse(x=[1, 2, 3], y=[1, 2, 3], width=30, height=20,
                     color="#386CB0", fill_color=None, line_width=2)

        show(plot)

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.hex(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1")

        show(plot)

u$  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300, match_aspect=True)
        plot.hex_tile(r=[0, 0, 1], q=[1, 2, 2], fill_color="#74ADD1")

        show(plot)

uÅ   
.. note::
    If both ``palette`` and ``color_mapper`` are passed, a ``ValueError``
    exception will be raised. If neither is passed, then the ``Greys9``
    palette will be used as a default.

u…   
.. note::
    The ``image_rgba`` method accepts images as a two-dimensional array of RGBA
    values (encoded as 32-bit integers).

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.inverted_triangle(x=[1, 2, 3], y=[1, 2, 3], size=20, color="#DE2D26")

        show(plot)

u  
Examples:

    .. bokeh-plot::
       :source-position: above

       from bokeh.plotting import figure, output_file, show

       p = figure(title="line", plot_width=300, plot_height=300)
       p.line(x=[1, 2, 3, 4, 5], y=[6, 7, 2, 4, 5])

       show(p)

u¡  
.. note::
    For this glyph, the data is not simply an array of scalars, it is an
    "array of arrays".

Examples:

    .. bokeh-plot::
       :source-position: above

       from bokeh.plotting import figure, output_file, show

       p = figure(plot_width=300, plot_height=300)
       p.multi_line(xs=[[1, 2, 3], [2, 3, 4]], ys=[[6, 7, 2], [4, 5, 7]],
                    color=['red','green'])

       show(p)

uï  
.. note::
    For this glyph, the data is not simply an array of scalars, it is a
    nested array.

Examples:

    .. bokeh-plot::
       :source-position: above

       from bokeh.plotting import figure, output_file, show

       p = figure(plot_width=300, plot_height=300)
       p.multi_polygons(xs=[[[[1, 1, 2, 2]]], [[[1, 1, 3], [1.5, 1.5, 2]]]],
                        ys=[[[[4, 3, 3, 4]]], [[[1, 3, 1], [1.5, 2, 1.5]]]],
                        color=['red', 'green'])
       show(p)

u=  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.oval(x=[1, 2, 3], y=[1, 2, 3], width=0.2, height=0.4,
                  angle=-0.7, color="#1D91C0")

        show(plot)

u  
Examples:

    .. bokeh-plot::
       :source-position: above

       from bokeh.plotting import figure, output_file, show

       p = figure(plot_width=300, plot_height=300)
       p.patch(x=[1, 2, 3, 2], y=[6, 7, 2, 2], color="#99d8c9")

       show(p)

uœ  
.. note::
    For this glyph, the data is not simply an array of scalars, it is an
    "array of arrays".

Examples:

    .. bokeh-plot::
       :source-position: above

       from bokeh.plotting import figure, output_file, show

       p = figure(plot_width=300, plot_height=300)
       p.patches(xs=[[1,2,3],[4,5,6,5]], ys=[[1,2,1],[4,5,5,4]],
                 color=["#43a2ca", "#a8ddb5"])

       show(p)

uH  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.quad(top=[2, 3, 4], bottom=[1, 2, 3], left=[1, 2, 3],
                  right=[1.2, 2.5, 3.7], color="#B3DE69")

        show(plot)

u=  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.ray(x=[1, 2, 3], y=[1, 2, 3], length=45, angle=-0.7, color="#FB8072",
                 line_width=2)

        show(plot)

u\  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.rect(x=[1, 2, 3], y=[1, 2, 3], width=10, height=20, color="#CAB2D6",
                  width_units="screen", height_units="screen")

        show(plot)

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.step(x=[1, 2, 3, 4, 5], y=[1, 2, 3, 2, 5], color="#FB8072")

        show(plot)

ug  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.segment(x0=[1, 2, 3], y0=[1, 2, 3], x1=[1, 2, 3],
                     y1=[1.2, 2.5, 3.7], color="#F4A582",
                     line_width=3)

        show(plot)

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.square(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,30], color="#74ADD1")

        show(plot)

uY  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.square_cross(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                          color="#7FC97F",fill_color=None, line_width=2)

        show(plot)

uQ  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.square_x(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                      color="#FDAE6B",fill_color=None, line_width=2)

        show(plot)

u¸   
.. note::
    The location and angle of the text relative to the ``x``, ``y`` coordinates
    is indicated by the alignment and baseline text properties.

Returns:
    GlyphRenderer

uA  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.triangle(x=[1, 2, 3], y=[1, 2, 3], size=[10,20,25],
                      color="#99D594", line_width=2)

        show(plot)

u/  
Examples:

   .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.varea(x=[1, 2, 3], y1=[0, 0, 0], y2=[1, 4, 2],
                   fill_color="#99D594")

        show(plot)

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.vbar(x=[1, 2, 3], width=0.5, bottom=0, top=[1,2,3], color="#CAB2D6")

        show(plot)

u^  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.wedge(x=[1, 2, 3], y=[1, 2, 3], radius=15, start_angle=0.6,
                   end_angle=4.1, radius_units="screen", color="#2b8cbe")

        show(plot)

u  
Examples:

    .. bokeh-plot::
        :source-position: above

        from bokeh.plotting import figure, output_file, show

        plot = figure(plot_width=300, plot_height=300)
        plot.x(x=[1, 2, 3], y=[1, 2, 3], size=[10, 20, 25], color="#fa9fb5")

        show(plot)

c         O` s|   | j  d d ƒ } t | t ƒ r: | t k r: t | } n  | d k rb d | k rb |  j | | Ž  S|  j d | | | Ž Sd S(   uz   Creates a scatter plot of the given x and y items.

        Args:
            x (str or seq[float]) : values or field names of center x coordinates

            y (str or seq[float]) : values or field names of center y coordinates

            size (str or list[float]) : values or field names of sizes in screen units

            marker (str, or list[str]): values or field names of marker types

            color (color value, optional): shorthand to set both fill and line color

            source (:class:`~bokeh.models.sources.ColumnDataSource`) : a user-supplied data source.
                An attempt will be made to convert the object to :class:`~bokeh.models.sources.ColumnDataSource`
                if needed. If none is supplied, one is created for the user automatically.

            **kwargs: :ref:`userguide_styling_line_properties` and :ref:`userguide_styling_fill_properties`

        Examples:

            >>> p.scatter([1,2,3],[4,5,6], marker="square", fill_color="red")
            >>> p.scatter("data1", "data2", marker="mtype", source=data_source, ...)

        .. note::
            When passing ``marker="circle"`` it is also possible to supply a
            ``radius`` value in data-space units. When configuring marker type
            from a data source column, *all* markers incuding circles may only
            be configured with ``size`` in screen units.

        u   markeru   circleu   radiust   markerN(   R+   R/   R   t   _MARKER_SHORTCUTSt   circlet   _scatter(   RF   t   argst   kwargst   marker_type(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   scatterô  s     u	   pointytopu
   Viridis256i   c	         K` sÎ   d d l  m }
 |
 | | | | d | ƒ} | d k rX t d | d t | j ƒ ƒ } n  t d t d | j d | j	 d	 | j ƒ ƒ } |  j
 d d
 d d d | d | d | d | d | d | |	  } | | f S(   uê   Perform a simple equal-weight hexagonal binning.

        A :class:`~bokeh.models._glyphs.HexTile` glyph will be added to display
        the binning. The :class:`~bokeh.models.sources.ColumnDataSource` for
        the glyph will have columns ``q``, ``r``, and ``count``, where ``q``
        and ``r`` are `axial coordinates`_ for a tile, and ``count`` is the
        associated bin count.

        It is often useful to set ``match_aspect=True`` on the associated plot,
        so that hexagonal tiles are all regular (i.e. not "stretched") in
        screen space.

        For more sophisticated use-cases, e.g. weighted binning or individually
        scaling hex tiles, use :func:`hex_tile` directly, or consider a higher
        level library such as HoloViews.

        Args:
            x (array[float]) :
                A NumPy array of x-coordinates to bin into hexagonal tiles.

            y (array[float]) :
                A NumPy array of y-coordinates to bin into hexagonal tiles

            size (float) :
                The size of the hexagonal tiling to use. The size is defined as
                distance from the center of a hexagon to a corner.

                In case the aspect scaling is not 1-1, then specifically `size`
                is the distance from the center to the "top" corner with the
                `"pointytop"` orientation, and the distance from the center to
                a "side" corner with the "flattop" orientation.

            orientation ("pointytop" or "flattop", optional) :
                Whether the hexagonal tiles should be oriented with a pointed
                corner on top, or a flat side on top. (default: "pointytop")

            palette (str or seq[color], optional) :
                A palette (or palette name) to use to colormap the bins according
                to count. (default: 'Viridis256')

                If ``fill_color`` is supplied, it overrides this value.

            line_color (color, optional) :
                The outline color for hex tiles, or None (default: None)

            fill_color (color, optional) :
                An optional fill color for hex tiles, or None. If None, then
                the ``palette`` will be used to color map the tiles by
                count. (default: None)

            aspect_scale (float) :
                Match a plot's aspect ratio scaling.

                When working with a plot with ``aspect_scale != 1``, this
                parameter can be set to match the plot, in order to draw
                regular hexagons (instead of "stretched" ones).

                This is roughly equivalent to binning in "screen space", and
                it may be better to use axis-aligned rectangular bins when
                plot aspect scales are not one.

        Any additional keyword arguments are passed to :func:`hex_tile`.

        Returns
            (Glyphrender, DataFrame)
                A tuple with the ``HexTile`` renderer generated to display the
                binning, and a Pandas ``DataFrame`` with columns ``q``, ``r``,
                and ``count``, where ``q`` and ``r`` are `axial coordinates`_
                for a tile, and ``count`` is the associated bin count.

        Example:

            .. bokeh-plot::
                :source-position: above

                import numpy as np
                from bokeh.models import HoverTool
                from bokeh.plotting import figure, show

                x = 2 + 2*np.random.standard_normal(500)
                y = 2 + 2*np.random.standard_normal(500)

                p = figure(match_aspect=True, tools="wheel_zoom,reset")
                p.background_fill_color = '#440154'
                p.grid.visible = False

                p.hexbin(x, y, size=0.5, hover_color="pink", hover_alpha=0.8)

                hover = HoverTool(tooltips=[("count", "@c"), ("(q,r)", "(@q, @r)")])
                p.add_tools(hover)

                show(p)

        .. _axial coordinates: https://www.redblobgames.com/grids/hexagons/#coordinates-axial

        i   (   t   hexbint   aspect_scaleu   ci    t   datat   qt   rt   cu   qu   rt   sizet   orientationt   sourcet
   line_colort
   fill_colorN(   t   util.hexRU   R.   R   t   maxt   countsR   t   dictRX   RY   t   hex_tile(   RF   t   xt   yR[   R\   t   paletteR^   R_   RV   RR   RU   t   binsR]   RY   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyRU   "  s    a!-'c         K` s@   g  } x3 t  | d d |  D] } | j |  j |   ƒ q W| S(   ut   Generate multiple ``HArea`` renderers for levels stacked left
        to right.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``x1`` and ``x2`` harea coordinates.

                Additionally, the ``name`` of the renderer will be set to
                the value of each successive stacker (this is useful with the
                special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``harea``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2016* and *2017*, then the following call to ``harea_stack`` will
            will create two ``HArea`` renderers that stack:

            .. code-block:: python

                p.harea_stack(['2016', '2017'], y='y', color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.harea(x1=stack(),       x2=stack('2016'),         y='y', color='blue', source=source, name='2016')
                p.harea(x1=stack('2016'), x2=stack('2016', '2017'), y='y', color='red',  source=source, name='2017')

        u   x1u   x2(   R&   t   appendt   harea(   RF   t   stackersRH   t   result(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   harea_stack‘  s    %c         K` s@   g  } x3 t  | d d |  D] } | j |  j |   ƒ q W| S(   u   Generate multiple ``HBar`` renderers for levels stacked left to right.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``left`` and ``right`` bar coordinates.

                Additionally, the ``name`` of the renderer will be set to
                the value of each successive stacker (this is useful with the
                special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``hbar``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2106* and *2017*, then the following call to ``hbar_stack`` will
            will create two ``HBar`` renderers that stack:

            .. code-block:: python

                p.hbar_stack(['2016', '2017'], x=10, width=0.9, color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.hbar(bottom=stack(),       top=stack('2016'),         x=10, width=0.9, color='blue', source=source, name='2016')
                p.hbar(bottom=stack('2016'), top=stack('2016', '2017'), x=10, width=0.9, color='red',  source=source, name='2017')

        u   leftu   right(   R&   Ri   t   hbar(   RF   Rk   RH   Rl   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt
   hbar_stack»  s    $c         K` só   t  d „  | | f Dƒ ƒ r+ t d ƒ ‚ n  g  } t | t t f ƒ r‡ | | d <x0 t | d |  D] } | j |  j |   ƒ qc W| St | t t f ƒ rÝ | | d <x0 t | d |  D] } | j |  j |   ƒ q¹ W| S|  j | | |  g S(   u   Generate multiple ``Line`` renderers for lines stacked vertically
        or horizontally.

        Args:
            x (seq[str]) :

            y (seq[str]) :

        Additionally, the ``name`` of the renderer will be set to
        the value of each successive stacker (this is useful with the
        special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``hbar``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2106* and *2017*, then the following call to ``line_stack`` with
            stackers for the y-coordinates will will create two ``Line``
            renderers that stack:

            .. code-block:: python

                p.line_stack(['2016', '2017'], x='x', color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.line(y=stack('2016'),         x='x', color='blue', source=source, name='2016')
                p.line(y=stack('2016', '2017'), x='x', color='red',  source=source, name='2017')

        c         s` s$   |  ] } t  | t t f ƒ Vq d  S(   N(   R/   t   listt   tuple(   t   .0t   val(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pys	   <genexpr>  s    u,   Only one of x or y may be a list of stackersu   xu   y(   t   allR*   R/   Rp   Rq   R%   Ri   t   line(   RF   Re   Rf   RH   Rl   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   _line_stackä  s    '

c         K` s   |  j  d | |  S(   uJ   Generate multiple ``Line`` renderers for lines stacked horizontally.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``x`` line coordinates.

        Additionally, the ``name`` of the renderer will be set to
        the value of each successive stacker (this is useful with the
        special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``line``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2106* and *2017*, then the following call to ``hline_stack`` with
            stackers for the x-coordinates will will create two ``Line``
            renderers that stack:

            .. code-block:: python

                p.hline_stack(['2016', '2017'], y='y', color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.line(x=stack('2016'),         y='y', color='blue', source=source, name='2016')
                p.line(x=stack('2016', '2017'), y='y', color='red',  source=source, name='2017')

        Re   (   Rv   (   RF   Rk   RH   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   hline_stack  s    %c         K` s@   g  } x3 t  | d d |  D] } | j |  j |   ƒ q W| S(   ut   Generate multiple ``VArea`` renderers for levels stacked bottom
        to top.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``y1`` and ``y1`` varea coordinates.

                Additionally, the ``name`` of the renderer will be set to
                the value of each successive stacker (this is useful with the
                special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``varea``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2016* and *2017*, then the following call to ``varea_stack`` will
            will create two ``VArea`` renderers that stack:

            .. code-block:: python

                p.varea_stack(['2016', '2017'], x='x', color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.varea(y1=stack(),       y2=stack('2016'),         x='x', color='blue', source=source, name='2016')
                p.varea(y1=stack('2016'), y2=stack('2016', '2017'), x='x', color='red',  source=source, name='2017')

        u   y1u   y2(   R&   Ri   t   varea(   RF   Rk   RH   Rl   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   varea_stackE  s    %c         K` s@   g  } x3 t  | d d |  D] } | j |  j |   ƒ q W| S(   u˜   Generate multiple ``VBar`` renderers for levels stacked bottom
        to top.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``left`` and ``right`` bar coordinates.

                Additionally, the ``name`` of the renderer will be set to
                the value of each successive stacker (this is useful with the
                special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``vbar``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2016* and *2017*, then the following call to ``vbar_stack`` will
            will create two ``VBar`` renderers that stack:

            .. code-block:: python

                p.vbar_stack(['2016', '2017'], x=10, width=0.9, color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.vbar(bottom=stack(),       top=stack('2016'),         x=10, width=0.9, color='blue', source=source, name='2016')
                p.vbar(bottom=stack('2016'), top=stack('2016', '2017'), x=10, width=0.9, color='red',  source=source, name='2017')

        u   bottomu   top(   R&   Ri   t   vbar(   RF   Rk   RH   Rl   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt
   vbar_stacko  s    %c         K` s   |  j  d | |  S(   uH   Generate multiple ``Line`` renderers for lines stacked vertically.

        Args:
            stackers (seq[str]) : a list of data source field names to stack
                successively for ``y`` line coordinates.

        Additionally, the ``name`` of the renderer will be set to
        the value of each successive stacker (this is useful with the
        special hover variable ``$name``)

        Any additional keyword arguments are passed to each call to ``line``.
        If a keyword value is a list or tuple, then each call will get one
        value from the sequence.

        Returns:
            list[GlyphRenderer]

        Examples:

            Assuming a ``ColumnDataSource`` named ``source`` with columns
            *2106* and *2017*, then the following call to ``vline_stack`` with
            stackers for the y-coordinates will will create two ``Line``
            renderers that stack:

            .. code-block:: python

                p.vline_stack(['2016', '2017'], x='x', color=['blue', 'red'], source=source)

            This is equivalent to the following two separate calls:

            .. code-block:: python

                p.line(y=stack('2016'),         x='x', color='blue', source=source, name='2016')
                p.line(y=stack('2016', '2017'), x='x', color='red',  source=source, name='2017')

        Rf   (   Rv   (   RF   Rk   RH   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   vline_stack™  s    %c         K` s8   t  | | |  } t d | |  } |  j j | ƒ | S(   u2   Creates a network graph using the given node, edge and layout provider.

        Args:
            node_source (:class:`~bokeh.models.sources.ColumnDataSource`) : a user-supplied data source
                for the graph nodes. An attempt will be made to convert the object to
                :class:`~bokeh.models.sources.ColumnDataSource` if needed. If none is supplied, one is created
                for the user automatically.

            edge_source (:class:`~bokeh.models.sources.ColumnDataSource`) : a user-supplied data source
                for the graph edges. An attempt will be made to convert the object to
                :class:`~bokeh.models.sources.ColumnDataSource` if needed. If none is supplied, one is created
                for the user automatically.

            layout_provider (:class:`~bokeh.models.graphs.LayoutProvider`) : a ``LayoutProvider`` instance to
                provide the graph coordinates in Cartesian space.

            **kwargs: :ref:`userguide_styling_line_properties` and :ref:`userguide_styling_fill_properties`

        t   layout_provider(   R'   R   t	   renderersRi   (   RF   t   node_sourcet   edge_sourceR}   RR   RH   t   graph_renderer(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   graphÀ  s    N(j   t   __name__t
   __module__t   __doc__t   __subtype__t   __view_model__R1   R#   t   _glyphst   AnnularWedget   annular_wedget   Annulust   annulust   Arct   arct   _markerst   Asteriskt   asteriskt   Beziert   beziert   CircleRO   t   CircleCrosst   circle_crosst   CircleXt   circle_xt   Crosst   crosst   Dasht   dasht   Diamondt   diamondt   DiamondCrosst   diamond_crosst   HAreaRj   t   HBarRn   t   Ellipset   ellipset   Hext   hext   HexTileRd   t   Imaget   imaget	   ImageRGBAt
   image_rgbat   ImageURLt	   image_urlt   InvertedTrianglet   inverted_trianglet   LineRu   t	   MultiLinet
   multi_linet   MultiPolygonst   multi_polygonst   Ovalt   ovalt   Patcht   patcht   Patchest   patchest   Quadt   quadt	   Quadratict	   quadratict   Rayt   rayt   Rectt   rectt   Stept   stept   Segmentt   segmentt   Squaret   squaret   SquareCrosst   square_crosst   SquareXt   square_xt   TextR)   t   Trianglet   trianglet   VAreaRx   t   VBarRz   t   Wedget   wedget   XRe   t   ScatterRP   RT   R.   RU   Rm   Ro   Rv   Rw   Ry   R{   R|   R‚   (    (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyR(   8   s¼   K	 																																																																											.o	*	)	:	'	*	*	'c          K` s
   t  |    S(   N(   R(   (   RR   (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   figureÙ  s    u   asterisku   *u   crossu   +u   circleu   ou   circle_xu   oxu   circle_crossu   o+u   dashu   -u   inverted_triangleu   vu   triangleu   ^c           C` sO   t  d d j t t ƒ ƒ ƒ t  ƒ  t  d d j d „  t j ƒ  Dƒ ƒ ƒ d S(   uR    Prints a list of valid marker types for scatter()

    Returns:
        None
    u   Available markers: 

 - u   
 - u   Shortcuts: 

u   
c         s` s   |  ] } d  | Vq d S(   u    %r: %sN(    (   Rr   t   item(    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pys	   <genexpr>ð  s    N(   t   printt   joinRp   R   RN   t   items(    (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyR   è  s    R,   c        	   B` sý  e  Z e e e e e e e ƒ ƒ ƒ d  e d d ƒZ e	 d d ƒ Z
 e	 d d ƒ Z e e e d  d d d ƒZ e e e d  d d d ƒZ e e d  d d d ƒZ e e d  d	 d d
 ƒZ e d  d d d ƒ Z e d  d d d ƒ Z e e e e e ƒ d  d d d ƒZ e e e e e ƒ e e e ƒ ƒ d  d d d ƒZ e e e e e ƒ d  d d d ƒZ e e e e e ƒ d  d d d ƒZ e e e d d d d ƒ d  d d d ƒZ e e e d d d d ƒ d  d d d ƒZ  e e e! e" e e ƒ ƒ d d ƒZ# RS(   t   defaultt   helpu+   
    Tools the plot should start with.
    u,   
    Customize the x-range of the plot.
    u   autouD   
    Number of minor ticks between adjacent x-axis major ticks.
    uD   
    Number of minor ticks between adjacent y-axis major ticks.
    u   belowu-   
    Where the x-axis should be located.
    u   leftu-   
    Where the y-axis should be located.
    u    u!   
    A label for the x-axis.
    u!   
    A label for the y-axis.
    u5   
    Which drag tool should initially be active.
    u7   
    Which scroll tool should initially be active.
    u4   
    Which tap tool should initially be active.
    u   linearu   logu   datetimeu   mercatoru!   
    The type of the x-axis.
    u!   
    The type of the y-axis.
    u˜  
    An optional argument to configure tooltips for the Figure. This argument
    accepts the same values as the ``HoverTool.tooltips`` property. If a hover
    tool is specified in the ``tools`` argument, this value will override that
    hover tools ``tooltips`` value. If no hover tool is specified in the
    ``tools`` argument, then passing tooltips here will cause one to be created
    and added.
    ($   Rƒ   R„   R   R   R   R   R   t   DEFAULT_TOOLSR>   R   R2   R3   R   R	   R9   R<   R   R   R8   R   R;   R:   R=   R   RB   R   RC   R   RD   R   RE   R4   R6   R
   R   R?   (    (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyR,   ø  s@   '										*			!	!	u   coloru
   fill_coloru
   line_coloru   alphau
   fill_alphau
   line_alpha(A   t
   __future__R    R   R   R   t   loggingt	   getLoggerRƒ   t   logt   sixR   t   core.propertiesR   R   R   R   R	   R
   R   R   R   R   t
   core.enumsR   R   R   t   modelsR   R   R   R   R   R   Rˆ   R   R   t   models.toolsR   R   R   R   t   util.optionsR   t	   transformR   t   helpersR   R    R!   R"   R#   R$   R%   R&   R'   RÝ   t   __all__R(   RÖ   R…   RN   R,   t   sett   _color_fieldst   _alpha_fields(    (    (    s4   lib/python2.7/site-packages/bokeh/plotting/figure.pyt   <module>   sJ   "	F("@		ÿ ÿ ÿ ÿ ¥	
	K