HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyo
�
�)�Uc@sJdZddlZddlmZddljZddljZddlj	Z
ddljZ
ddlmZddlmZddljZddlmZddlmZddlZdejjZd	Zd
e
jfd��YZd�Zd
ejfd��YZ dejjZ!ejj"de!�dejfd��YZ#dS(s�
Support for plotting vector fields.

Presently this contains Quiver and Barb. Quiver plots an arrow in the
direction of the vector, with the size of the arrow related to the
magnitude of the vector.

Barbs are like quiver in that they point along a vector, but
the magnitude of the vector is given schematically by the presence of barbs
or flags on the barb.

This will also become a home for things such as standard
deviation ellipses, which can and will be derived very easily from
the Quiver code.
i����N(tma(tallow_rasterization(t	docstring(tdelete_masked_points(t
CirclePolygonsE
Plot a 2-D field of arrows.

call signatures::

  quiver(U, V, **kw)
  quiver(U, V, C, **kw)
  quiver(X, Y, U, V, **kw)
  quiver(X, Y, U, V, C, **kw)

Arguments:

  *X*, *Y*:

    The x and y coordinates of the arrow locations (default is tail of
    arrow; see *pivot* kwarg)

  *U*, *V*:

    give the *x* and *y* components of the arrow vectors

  *C*:
    an optional array used to map colors to the arrows

All arguments may be 1-D or 2-D arrays or sequences. If *X* and *Y*
are absent, they will be generated as a uniform grid.  If *U* and *V*
are 2-D arrays but *X* and *Y* are 1-D, and if len(*X*) and len(*Y*)
match the column and row dimensions of *U*, then *X* and *Y* will be
expanded with :func:`numpy.meshgrid`.

*U*, *V*, *C* may be masked arrays, but masked *X*, *Y* are not
supported at present.

Keyword arguments:

  *units*: ['width' | 'height' | 'dots' | 'inches' | 'x' | 'y' | 'xy']
    arrow units; the arrow dimensions *except for length* are in
    multiples of this unit.

    * 'width' or 'height': the width or height of the axes

    * 'dots' or 'inches': pixels or inches, based on the figure dpi

    * 'x', 'y', or 'xy': *X*, *Y*, or sqrt(X^2+Y^2) data units

    The arrows scale differently depending on the units.  For
    'x' or 'y', the arrows get larger as one zooms in; for other
    units, the arrow size is independent of the zoom state.  For
    'width or 'height', the arrow size increases with the width and
    height of the axes, respectively, when the the window is resized;
    for 'dots' or 'inches', resizing does not change the arrows.


   *angles*: ['uv' | 'xy' | array]
    With the default 'uv', the arrow aspect ratio is 1, so that
    if *U*==*V* the angle of the arrow on the plot is 45 degrees
    CCW from the *x*-axis.
    With 'xy', the arrow points from (x,y) to (x+u, y+v).
    Alternatively, arbitrary angles may be specified as an array
    of values in degrees, CCW from the *x*-axis.

  *scale*: [ None | float ]
    data units per arrow length unit, e.g. m/s per plot width; a smaller
    scale parameter makes the arrow longer.  If *None*, a simple
    autoscaling algorithm is used, based on the average vector length
    and the number of vectors.  The arrow length unit is given by
    the *scale_units* parameter

   *scale_units*: None, or any of the *units* options. For example,
    if *scale_units* is 'inches', *scale* is 2.0, and (u,v) = (1,0),
    then the vector will be 0.5 inches long.  If *scale_units* is
    'width', then the vector will be half the width of the axes.
    If *scale_units* is 'x' then the vector will be 0.5 x-axis
    units.  To plot vectors in the x-y plane, with u and v having
    the same units as x and y, use
    "angles='xy', scale_units='xy', scale=1".

  *width*:
    shaft width in arrow units; default depends on choice of units,
    above, and number of vectors; a typical starting value is about
    0.005 times the width of the plot.

  *headwidth*: scalar
    head width as multiple of shaft width, default is 3

  *headlength*: scalar
    head length as multiple of shaft width, default is 5

  *headaxislength*: scalar
    head length at shaft intersection, default is 4.5

  *minshaft*: scalar
    length below which arrow scales, in units of head length. Do not
    set this to less than 1, or small arrows will look terrible!
    Default is 1

  *minlength*: scalar
    minimum length as a multiple of shaft width; if an arrow length
    is less than this, plot a dot (hexagon) of this diameter instead.
    Default is 1.

  *pivot*: [ 'tail' | 'middle' | 'tip' ]
    The part of the arrow that is at the grid point; the arrow rotates
    about this point, hence the name *pivot*.

  *color*: [ color | color sequence ]
    This is a synonym for the
    :class:`~matplotlib.collections.PolyCollection` facecolor kwarg.
    If *C* has been set, *color* has no effect.

The defaults give a slightly swept-back arrow; to make the head a
triangle, make *headaxislength* the same as *headlength*. To make the
arrow more pointed, reduce *headwidth* or increase *headlength* and
*headaxislength*. To make the head smaller relative to the shaft,
scale down all the head parameters. You will probably do best to leave
minshaft alone.

linewidths and edgecolors can be used to customize the arrow
outlines. Additional :class:`~matplotlib.collections.PolyCollection`
keyword arguments:

%(PolyCollection)s
s�
Add a key to a quiver plot.

call signature::

  quiverkey(Q, X, Y, U, label, **kw)

Arguments:

  *Q*:
    The Quiver instance returned by a call to quiver.

  *X*, *Y*:
    The location of the key; additional explanation follows.

  *U*:
    The length of the key

  *label*:
    a string with the length and units of the key

Keyword arguments:

  *coordinates* = [ 'axes' | 'figure' | 'data' | 'inches' ]
    Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are
    normalized coordinate systems with 0,0 in the lower left and 1,1
    in the upper right; 'data' are the axes data coordinates (used for
    the locations of the vectors in the quiver plot itself); 'inches'
    is position in the figure in inches, with 0,0 at the lower left
    corner.

  *color*:
    overrides face and edge colors from *Q*.

  *labelpos* = [ 'N' | 'S' | 'E' | 'W' ]
    Position the label above, below, to the right, to the left of the
    arrow, respectively.

  *labelsep*:
    Distance in inches between the arrow and the label.  Default is
    0.1

  *labelcolor*:
    defaults to default :class:`~matplotlib.text.Text` color.

  *fontproperties*:
    A dictionary with keyword arguments accepted by the
    :class:`~matplotlib.font_manager.FontProperties` initializer:
    *family*, *style*, *variant*, *size*, *weight*

Any additional keyword arguments are used to override vector
properties taken from *Q*.

The positioning of the key depends on *X*, *Y*, *coordinates*, and
*labelpos*.  If *labelpos* is 'N' or 'S', *X*, *Y* give the position
of the middle of the key arrow.  If *labelpos* is 'E', *X*, *Y*
positions the head, and if *labelpos* is 'W', *X*, *Y* positions the
tail; in either of these two cases, *X*, *Y* is somewhere in the
middle of the arrow+label key object.
t	QuiverKeycBs�eZdZidd6dd6dd6dd6Zidd6d	d6dd6dd6Zid
d6d
d6dd6dd6Zd
�Zee_d�Zd�Z	d�Z
ed��Zd�Z
d�Zd�ZeZRS(s8 Labelled arrow for use as a quiver plot scale key.
    tcentertNtStlefttEtrighttWtbottomttoptmidttipttailc	
s�tjj��|�_|�_|�_|�_|jdd��_|jdd��_
|�_|jdd��_�j|j
jj�_�fd�}|j
jjjd|�|jdd	��_|jd
d��_|jdt���_|�_�j}tjd|d
�j�jd�j�jdtj|���_�jdk	rz�jj�j�nt �_!|j"d�_"dS(Ntcoordinatestaxestcolortlabelsepg�������?cs �j|j�_t�_dS(N(t_labelsep_inchestdpiRtFalset_initialized(tfig(tself(sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt
on_dpi_change�stdpi_changedtlabelposRt
labelcolortfontpropertiesttextthorizontalalignmenttverticalalignment(#tmartisttArtistt__init__tQtXtYtUtpoptcoordtNoneRtlabelRtaxtfigureRRt	callbackstconnectRRtdictR tkwtmtexttTextthaligntvaligntfont_managertFontPropertiesR!t	set_colorRRtzorder(	RR'R(R)R*R.R4Rt_fp((RsD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR&�s2								cCs8tr4|j�|jj}|j|j|j_|jj}tj|j_|jjt	j
|jg�t	jd��|_
||j_||j_|jj}|j|j�tj|j
d|j|jfgd|j�|�|_|jdk	r|jj|j�n|jj|jj��t|_ndS(NitoffsetsttransOffset(i(tTruet_set_transformR'tpivotRtUmaskRtnomaskt_make_vertstnptarrayR*tzerostvertstpolykwtupdateR4tcollectionstPolyCollectionR(R)t
get_transformtvectorRR-R;t
set_transformR(Rt_pivott_maskR4((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_inits(
	cCs<|jdkr||jS|jdkr4||jS|SdS(NR
R(RR(Rtx((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_text_xs
cCs<|jdkr||jS|jdkr4||jS|SdS(NRR(RR(Rty((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_text_y&s
cCs�|j�|jj|�|j�j|j|jf�\}}|jj|j	|��|jj
|j|��|jj|�dS(N(RSROtdrawRNttransform_pointR(R)R!tset_xRUtset_yRW(RtrendererRTRV((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRX.s
'cCs�|jdkr(|j|jjj�n�|jdkrP|j|jjj�nb|jdkr{|j|jjjj�n7|jdkr�|j|jjjj�nt	d��dS(NtdataRR0tinchessunrecognized coordinates(
R,RPR'R/t	transDatat	transAxesR0ttransFiguretdpi_scale_transt
ValueError(R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRA8scCs'tjj||�|jj|�dS(N(R$R%t
set_figureR!(RR((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRdDscCs@|jj|�ds,|jj|�dr6tifStifS(Ni(R!tcontainsROR@R(Rt
mouseevent((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyReHs
(t__name__t
__module__t__doc__R7R8RBR&t_quiverkey_docRSRURWRRXRARdRet
quiverkey_doc(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR�s"""	$				
			c
Gs�dgd\}}}}}t|�}t|�dksLt|�dkrgtj|jd��}ntj|jd��}tj|jd��}|jdkr�d|jd}}n|j\}}t|�dkrgg|D]}tj|�j	�^q�\}}t|�|kr�t|�|kr�gtj
||�D]}|j	�^qC\}}q�nLtj
tj|�tj|��}	g|	D]}tj	|�^q�\}}|||||fS(Niii����iii(R-tlisttlenRFt
atleast_1dR+tndimtshapeRGtraveltmeshgridtarange(
targsR(R)R*tVtCtnrtnctat	indexgrid((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_parse_argsVs $.$7$(tQuivercBs�eZdZeje�d��Zd�Zed��Z	dd�Zd�Zd�Z
dd�Zd	�Zd
�ZeZRS(sr
    Specialized PolyCollection for arrows.

    The only API method is set_UVC(), which can be used
    to change the size, orientation, and color of the
    arrows; their locations are fixed when the class is
    instantiated.  Possibly this method will be useful
    in animations.

    Much of the work in this class is done in the draw()
    method so that as much information as possible is available
    about the plot.  In subsequent draw() calls, recalculation
    is limited to things that might have changed, so there
    should be no performance penalty from putting the calculations
    in the draw() method.
    c

s9|�_t|�\}}}}}|�_|�_tj|dd�tjf|dd�tjff��_t|��_	|j
dd��_|j
dd��_
t|j
dd���_|j
dd��_|j
d	d
��_|j
dd
��_|j
dd
��_|j
dd��_|j
dd��_|j
d
d��_|j
dd��_|j
dd��_|jd�j�|jdd�tjj�gd�jd|jdt|�|�_�j |||�t�_!d�_"d�_#�fd�}	�jj$j%j&d|	�dS(s�
        The constructor takes one required argument, an Axes
        instance, followed by the args and kwargs described
        by the following pylab interface documentation:
        %sNtscalet	headwidthit
headlengthitheadaxislengthg@tminshaftit	minlengthtunitstwidthtscale_unitstanglestuvRtkRBRt
facecolorst
linewidthsiR>R?tclosedcst�_t�_dS(N(R@t_new_UVRR(R(R(sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR�s	R(i('R/R{R(R)RFthstacktnewaxistXYRmRR+R-R}R~tfloatRR�R�R�R�R�R�R�RRBt
setdefaultRLRMR&R_RRJtset_UVCRtkeyvectkeytextR0R1R2(
RR/RtR4R(R)R*RuRvR((RsD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR&�s>			>					cCs�tr�|j�}|j}|j�j|jj|jjf�\}}||_|jdkr�t
dtdtj
|j���}d|j||_q�ndS(s]
        Initialization delayed until first draw;
        allow time for axes setup.
        iig���Q��?N(R@RAR/tinvertedRYtbboxR�theighttspanR-tmaxtmintmathtsqrtR(RttransR/tsxtsytsn((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRS�s	!	$cCs|j�|js1|jdks1|jdkrh|j|j|j�}|j|dt�t|_nt	j
j||�dS(NtxyRTRVR�(RTRVsxy(RSR�R�R�RER*Rut	set_vertsRRLRMRX(RR\RI((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRX�s
cCs4tj|dt�j�}tj|dt�j�}tj|j|jdtdt�}|dk	r�tj|dt�j�}tj||jdtdt�}|tjkr�|j	�}q�tj
|d|dt�}n|j	d�|_|j	d�|_||_
|dk	r'|j|�nt|_dS(Ntcopytshrinktmaski(Rtmasked_invalidRRqtmask_orR�R@R-RDtfilledRGR*RuRCt	set_arrayR�(RR*RuRvR�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR��s$!	c
CsL|j}|d
kr�|dkr<|jj}|jj}n�|dkrc|jj}|jj}nf|jj}|jj}|jj}|jj}tj||||�}tj||||�}||}	nr|dkr�|jj}	nW|dkr|jj}	n<|dkr!d}	n'|dkr<|jj}	nt	d	��|	S(sK
        Return a scale factor for converting from units to pixels
        RTRVR�R�R�tdotsg�?R^sunrecognized units(RTRVsxy(
R/tviewLimR�R�R�RFR�R0RRc(
RR�R/tdx0tdx1tdxx0tdxx1tdyy0tdyy1tdx((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_dots_per_unit�s2	
	cCsA|j|j�}||_tj�j|�}|j|�|S(sf
        Sets the PolygonCollection transform to go
        from arrow width units to pixels.
        (R�R�t_trans_scalet
transformstAffine2DR}RP(RR�R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyRA�s
	
ic
Cs�|jjj|j�}tj|dd�tjf|dd�tjff�}|jjj|j||�}||}tj|dd�df|dd�df�}tj|dd�df|dd�dfd�|}	||	fS(Niiy�?(	R/R_t	transformR�RFR�R�tarctan2tabsolute(
RR*RutepsR�R�txyptdxyR�tlengths((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_angles_lengths	s; 
2;cCs*||d}|jdkrM|jdkrM|j||dd�\}}n[|jdksk|jdkr�|j||dtj|jjj�j�d�\}}n|jdkr�|}ntj	|�}|j
dkrFtdtj
|j��}|jtjk	r"||jj�}n|j�}d|||j}	n|jdkry|j
dkrp|	|_
nd}
nV|jdkr�d}n|j|j�}||j}
|j
dkr�|	|
|_
n||
|j
|j}|j|�\}
}|jdkr|}n_|jd	kr5tj|�}n>tj|jd
t�jd�}|j�}|tjd9}|jddf|_|
|dtjd|�|j}|dd�dd�tj f}tj!|j"|j#fd
d�}|jtjk	r&tj$|�}tj%||j<n|S(Ny�?R�R�ig����MbP?i
g������?g�?R�R�ig�f@taxisi(&R�R�R�RFtabsR/tdataLimtextentsR�R�R}R-R�R�RRCRRDtmeanR�R�R�R�t	_h_arrowstangleR�RR�RqtpiRptexpR�tconcatenatetrealtimagRGtmasked(RR*RuR�R�R�RyR�tameanR}twidthu_per_lenuR�tlengthR(R)tthetaR�R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyREsT!.			
	!&"!cCs�|j|j}t|�}|j|d�}tj|ddd|�tjd|j|jdgtj�}|tjddddg�|}dtjdd|j	dgtj�}tj
|tjdd�f|dd�}tjd||j||j|gtj�}dtjdd|j	dgtj�}dddd	ddddg}|j|d�}	|j|d�}
|
dd�d	d
�fcd
9<|j|�}|j|�}|d	d
c!d
9+||}
|
|tjdd�f}|
|tjdd�f}tj
||kddd�}tj
|	||�tj
|
||�|jd	 dkr�|	d|	dd�d	tjf8}	n6|jd	 d
kr�|	|	dd�d	tjf}	n||jk}|j�r�tjdddtj�tjd}tj|�|jd}tj|�|jd}tj
|tjdd�f|dd�}tj
|tjdd�f|dd�}tj
|dd�}tj
|	||�tj
|
||�n|	|
fS(s  length is in arrow width units iiiitoutg�?NR�ii����iRRg@i(R�RRmtreshapeRFtclipRGR�tfloat64R~trepeatR�ttaketputmaskRBR�tanyRsR�tcostsin(RR�tminshRRTRVtx0ty0tiiR(R)tX0tY0R�tshortttooshorttthtx1ty1tX1tY1((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR�QsP#(+("
'#&++N(RgRhRiRtSubstitutiont_quiver_docR&RSRRXR-R�R�RAR�RER�t
quiver_doc(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR|ns0	
	!		=	8s�
Plot a 2-D field of barbs.

call signatures::

  barb(U, V, **kw)
  barb(U, V, C, **kw)
  barb(X, Y, U, V, **kw)
  barb(X, Y, U, V, C, **kw)

Arguments:

  *X*, *Y*:
    The x and y coordinates of the barb locations
    (default is head of barb; see *pivot* kwarg)

  *U*, *V*:
    give the *x* and *y* components of the barb shaft

  *C*:
    an optional array used to map colors to the barbs

All arguments may be 1-D or 2-D arrays or sequences. If *X* and *Y*
are absent, they will be generated as a uniform grid.  If *U* and *V*
are 2-D arrays but *X* and *Y* are 1-D, and if len(*X*) and len(*Y*)
match the column and row dimensions of *U*, then *X* and *Y* will be
expanded with :func:`numpy.meshgrid`.

*U*, *V*, *C* may be masked arrays, but masked *X*, *Y* are not
supported at present.

Keyword arguments:

  *length*:
    Length of the barb in points; the other parts of the barb
    are scaled against this.
    Default is 9

  *pivot*: [ 'tip' | 'middle' ]
    The part of the arrow that is at the grid point; the arrow rotates
    about this point, hence the name *pivot*.  Default is 'tip'

  *barbcolor*: [ color | color sequence ]
    Specifies the color all parts of the barb except any flags.  This
    parameter is analagous to the *edgecolor* parameter for polygons,
    which can be used instead. However this parameter will override
    facecolor.

  *flagcolor*: [ color | color sequence ]
    Specifies the color of any flags on the barb.  This parameter is
    analagous to the *facecolor* parameter for polygons, which can be
    used instead. However this parameter will override facecolor.  If
    this is not set (and *C* has not either) then *flagcolor* will be
    set to match *barbcolor* so that the barb has a uniform color. If
    *C* has been set, *flagcolor* has no effect.

  *sizes*:
    A dictionary of coefficients specifying the ratio of a given
    feature to the length of the barb. Only those values one wishes to
    override need to be included.  These features include:

        - 'spacing' - space between features (flags, full/half barbs)

        - 'height' - height (distance from shaft to top) of a flag or
          full barb

        - 'width' - width of a flag, twice the width of a full barb

        - 'emptybarb' - radius of the circle used for low magnitudes

  *fill_empty*:
    A flag on whether the empty barbs (circles) that are drawn should
    be filled with the flag color.  If they are not filled, they will
    be drawn such that no color is applied to the center.  Default is
    False

  *rounding*:
    A flag to indicate whether the vector magnitude should be rounded
    when allocating barb components.  If True, the magnitude is
    rounded to the nearest multiple of the half-barb increment.  If
    False, the magnitude is simply truncated to the next lowest
    multiple.  Default is True

  *barb_increments*:
    A dictionary of increments specifying values to associate with
    different parts of the barb. Only those values one wishes to
    override need to be included.

        - 'half' - half barbs (Default is 5)

        - 'full' - full barbs (Default is 10)

        - 'flag' - flags (default is 50)

  *flip_barb*:
    Either a single boolean flag or an array of booleans.  Single
    boolean indicates whether the lines and flags should point
    opposite to normal for all barbs.  An array (which should be the
    same size as the other data arrays) indicates whether to flip for
    each individual barb.  Normal behavior is for the barbs and lines
    to point right (comes from wind barbs having these features point
    towards low pressure in the Northern Hemisphere.)  Default is
    False

Barbs are traditionally used in meteorology as a way to plot the speed
and direction of wind observations, but can technically be used to
plot any two dimensional vector quantity.  As opposed to arrows, which
give vector magnitude by the length of the arrow, the barbs give more
quantitative information about the vector magnitude by putting slanted
lines or a triangle for various increments in magnitude, as show
schematically below::

 :     /\    \
 :    /  \    \
 :   /    \    \    \
 :  /      \    \    \
 : ------------------------------

.. note the double \ at the end of each line to make the figure
.. render correctly

The largest increment is given by a triangle (or "flag"). After those
come full lines (barbs). The smallest increment is a half line.  There
is only, of course, ever at most 1 half line.  If the magnitude is
small and only needs a single half-line and no full lines or
triangles, the half-line is offset from the end of the barb so that it
can be easily distinguished from barbs with a single full line.  The
magnitude for the barb shown above would nominally be 65, using the
standard increments of 50, 10, and 5.

linewidths and edgecolors can be used to customize the barb.
Additional :class:`~matplotlib.collections.PolyCollection` keyword
arguments:

%(PolyCollection)s
t	barbs_doctBarbscBskeZdZejd��Zedddd�Zd�Zd	d�Z
d�Zej
jje_eZRS(
s>
    Specialized PolyCollection for barbs.

    The only API method is :meth:`set_UVC`, which can be used to
    change the size, orientation, and color of the arrows.  Locations
    are changed using the :meth:`set_offsets` collection method.
    Possibly this method will be useful in animations.

    There is one internal function :meth:`_find_tails` which finds
    exactly what should be put on the barb given the vector magnitude.
    From there :meth:`_make_barbs` is used to find the vertices of the
    polygon to represent the barb based on this information.
    c
	Os�|jdd�|_|jdd�|_|jdd�}|jdd�}|jdt��|_|jdt�|_|jd	t��|_|jd
t	�|_
|jdt�|_d||fkrd|d
<|r�||d<q&|r�||d<q&|jdd�n||d
<||d<t
|�\}}}}	}
||_||_tj|dd�tjf|dd�tjff�}|jdd}tjj|g|fd|d|j|�|jtj��|j||	|
�dS(s�
        The constructor takes one required argument, an Axes
        instance, followed by the args and kwargs described
        by the following pylab interface documentation:
        %(barbs_doc)sRBRR�it	barbcolort	flagcolortsizest
fill_emptytbarb_incrementstroundingt	flip_barbtfacet
edgecolorsR�R�NiiR>R?(R+RQt_lengthR-R3R�RR�R�R@R�tflipR�R{RTRVRFR�R�RLRMR&R_RPR�tIdentityTransformR�(
RR/RtR4R�R�RTRVtutvtcR�t	barb_size((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR&'s6




		;
ii
i2c
Cs�|r'|||djtj�}ntj||�jtj�}tj||�}tj||�jtj�}tj||�}||k}||dkB|dkB}	||||	fS(sX
        Find how many of each of the tail pieces is necessary.  Flag
        specifies the increment for a flag, barb for a full barb, and half for
        half a barb. Mag should be the magnitude of a vector (ie. >= 0).

        This returns a tuple of:

            (*number of flags*, *number of barbs*, *half_flag*, *empty_flag*)

        *half_flag* is a boolean whether half of a barb is needed,
        since there should only ever be one half on a given
        barb. *empty_flag* flag is an array of flags to easily tell if
        a barb is empty (too low to plot any barbs/flags.
        g�?i(tastypeRFtinttfloortmod(
RtmagR�thalftfulltflagt	num_flagstnum_barbt	half_flagt
empty_flag((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_find_tailsWs!cCs�||	jdd�}||	jdd�}
||	jdd�}||	jdd�}td	d
d|d�}|r�|
}
nd
}||j�}tj||�tjd
}tdd|�j�}|
r�|}n"tj	||ddd�f�}g}x�tj
|�D]�\}}||r>|j|�qn||fg}|}x�t||�D]u}||kr�||d7}n|j
|||g||
||d
|g||||gg�|||8}qdWxbt||�D]P}|j
|||f||
|||d
f|||fg�||8}q�W||r�||kr�|j|||f�|d|8}n|j
|||f||
d
|||df|||fg�ntj�j|�j|�}|j|�qW|S(sv
        This function actually creates the wind barbs.  *u* and *v*
        are components of the vector in the *x* and *y* directions,
        respectively.

        *nflags*, *nbarbs*, and *half_barb*, empty_flag* are,
        *respectively, the number of flags, number of barbs, flag for
        *half a barb, and flag for empty barb, ostensibly obtained
        *from :meth:`_find_tails`.

        *length* is the length of the barb staff in points.

        *pivot* specifies the point on the barb around which the
        entire barb should be rotated.  Right now, valid options are
        'head' and 'middle'.

        *sizes* is a dictionary of coefficients specifying the ratio
        of a given feature to the length of the barb. These features
        include:

            - *spacing*: space between features (flags, full/half
               barbs)

            - *height*: distance from shaft of top of a flag or full
               barb

            - *width* - width of a flag, twice the width of a full barb

            - *emptybarb* - radius of the circle used for low
               magnitudes

        *fill_empty* specifies whether the circle representing an
        empty barb should be filled or not (this changes the drawing
        of the polygon).

        *flip* is a flag indicating whether the features should be flipped to
        the other side of the barb (useful for winds in the southern
        hemisphere.

        This function returns list of arrays of vertices, defining a polygon for
        each of the wind barbs.  These polygons have been rotated to properly
        align with the vector direction.
        tspacingg�?R�g�������?R�g�?t	emptybarbg333333�?Rgtmiddleg@iitradiusNi����g�?i(ii(tgetR3tlowerRR�RFR�Rt	get_vertsR�tndenumeratetappendtrangetextendR�R�trotateR�(RR�R�tnflagstnbarbst	half_barbRR�RBR�R�R�R	tfull_heightt
full_widtht	empty_radtpivot_pointstendxtendyR�tcirct
empty_barbt	barb_listtindexR�t
poly_vertstoffsetti((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt_make_barbswsX0
	"


	cCs�tj|dt�j�|_tj|dt�j�|_|dk	r�tj|dt�j�}t|jj�|j	j�|j|j|�\}}}}}n9t|jj�|j	j�|j|j�\}}}}t
j||||�}	|j|	|j
|j�\}
}}}
|j|||
|||
|j|j|j|j|j�}|j|�|dk	r�|j|�nt
j|dd�t
jf|dd�t
jff�}||_dS(NR�(RR�RRqR�R�R-RRTRVRFR�RR�R�R%R�RQR�R�R�R�R�R�R�t_offsets(RR*RuRvR�RTRVR�R�t	magnitudetflagstbarbsthalvestemptyt
plot_barbsR�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR��s$'	$
;cCs�|dd�df|_|dd�df|_t|jj�|jj�|j|j�\}}}}tj|dd�tjf|dd�tjff�}t	j
j||�dS(s
        Set the offsets for the barb polygons.  This saves the offets passed in
        and actually sets version masked as appropriate for the existing U/V
        data. *offsets* should be a sequence.

        ACCEPTS: sequence of pairs of floats
        Nii(RTRVRRqR�R�RFR�R�RLRMtset_offsets(RR�RTRVR�R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR-s!;N(RgRhRiRtinterpdR&R@RR%R-R�R-RLRMt
_barbs_docR�(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyR�s
0 	�	($RitnumpyRFRtmatplotlib.collectionsRLtmatplotlib.transformsR�tmatplotlib.textR!R5tmatplotlib.artisttartistR$Rt
matplotlibRtmatplotlib.font_managerR9tmatplotlib.cbookRtmatplotlib.patchesRR�R.tparamsR�RjR%RR{RMR|R/RKR�(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/quiver.pyt<module>s*}=|	��