Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/matplotlib/__pycache__/quiver.cpython-37.pyc

663 lines
35 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]<5D><><00>@s<>dZddlZddlZddlZddlmZddlmZmZm Z ddl
m Z ddl mZddlmZddlmZddlmZdejjZdZGdd <09>d e j<1B>Zd
d <0B>Zd d <0A>ZGdd<0F>dej<1F>Z dejjZ!ejj"e!d<11>Gdd<13>dej<1F>Z#dS)a<>
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.
<EFBFBD>N)<01>ma)<03>cbook<6F> docstring<6E> font_manager)<01> CirclePolygonaT
Plot a 2D field of arrows.
Call signature::
quiver([X, Y], U, V, [C], **kw)
Where *X*, *Y* define the arrow locations, *U*, *V* define the arrow
directions, and *C* optionally sets the color.
**Arrow size**
The default settings auto-scales the length of the arrows to a reasonable size.
To change this behavior see the *scale* and *scale_units* parameters.
**Arrow shape**
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.
**Arrow outline**
*linewidths* and *edgecolors* can be used to customize the arrow
outlines.
Parameters
----------
X, Y : 1D or 2D array-like, optional
The x and y coordinates of the arrow locations.
If not given, they will be generated as a uniform integer meshgrid based
on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D
using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``
must match the column and row dimensions of *U* and *V*.
U, V : 1D or 2D array-like
The x and y direction components of the arrow vectors.
C : 1D or 2D array-like, optional
Numeric data that defines the arrow colors by colormapping via *norm* and
*cmap*.
This does not support explicit colors. If you want to set colors directly,
use *color* instead.
units : {'width', 'height', 'dots', 'inches', 'x', 'y' 'xy'}, default: 'width'
The arrow dimensions (except for *length*) are measured in multiples of
this unit.
The following values are supported:
- 'width', 'height': The width or height of the axis.
- 'dots', 'inches': Pixels or inches based on the figure dpi.
- 'x', 'y', 'xy': *X*, *Y* or :math:`\sqrt{X^2 + Y^2}` in 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 window is resized;
for 'dots' or 'inches', resizing does not change the arrows.
angles : {'uv', 'xy'} or array-like, optional, default: 'uv'
Method for determining the angle of the arrows.
- 'uv': The arrow axis aspect ratio is 1 so that
if *U* == *V* the orientation of the arrow on the plot is 45 degrees
counter-clockwise from the horizontal axis (positive to the right).
Use this if the arrows symbolize a quantity that is not based on
*X*, *Y* data coordinates.
- 'xy': Arrows point from (x,y) to (x+u, y+v).
Use this for plotting a gradient field, for example.
- Alternatively, arbitrary angles may be specified explicitly as an array
of values in degrees, counter-clockwise from the horizontal axis.
In this case *U*, *V* is only used to determine the length of the
arrows.
Note: inverting a data axis will correspondingly invert the
arrows only with ``angles='xy'``.
scale : float, optional
Number of data units per arrow length unit, e.g., m/s per plot width; a
smaller scale parameter makes the arrow longer. Default is *None*.
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 : {'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, optional
If the *scale* kwarg is *None*, the arrow length unit. Default is *None*.
e.g. *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' or 'height', then the vector will be half the
width/height 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 : float, optional
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 : float, optional, default: 3
Head width as multiple of shaft width.
headlength : float, optional, default: 5
Head length as multiple of shaft width.
headaxislength : float, optional, default: 4.5
Head length at shaft intersection.
minshaft : float, optional, default: 1
Length below which arrow scales, in units of head length. Do not
set this to less than 1, or small arrows will look terrible!
minlength : float, optional, default: 1
Minimum length as a multiple of shaft width; if an arrow length
is less than this, plot a dot (hexagon) of this diameter instead.
pivot : {'tail', 'mid', 'middle', 'tip'}, optional, default: 'tail'
The part of the arrow that is anchored to the *X*, *Y* grid. The arrow
rotates about this point.
'mid' is a synonym for 'middle'.
color : color or color sequence, optional
Explicit color(s) for the arrows. If *C* has been set, *color* has no
effect.
This is a synonym for the `~.PolyCollection` *facecolor* parameter.
Other Parameters
----------------
**kwargs : `~matplotlib.collections.PolyCollection` properties, optional
All other keyword arguments are passed on to `.PolyCollection`:
%(PolyCollection)s
See Also
--------
quiverkey : Add a key to a quiver plot.
ae
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:
*angle* = 0
The angle of the key arrow. Measured in degrees anti-clockwise from the
x-axis.
*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.
c@s<>eZdZdZddddd<05>Zddddd<05>Zddd d
d<05>Zd d d ddd d d<10>dd<12>Zdd<14>Ze e_dd<16>Z
dd<18>Z dd<1A>Z e jdd<1C><00>Zdd<1E>Zdd <20>Zd!d"<22>Ze Zd S)#<23> QuiverKeyz3 Labelled arrow for use as a quiver plot scale key.<2E>center<65>left<66>right)<04>N<>S<>E<>WZbottom<6F>top<6F>middle<6C>tip<69>tailr<00>axesNg<4E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?r )<07>angle<6C> coordinates<65>color<6F>labelsep<65>labelpos<6F>
labelcolor<EFBFBD>fontpropertiesc s<>tj<01>|<00>||_||_||_||_||_||_||_ ||_
| |_ |j |j j j|_t<10>|<00><01><00>fdd<02>}|j j j<12>d|<0E>|_|
|_| |_| p<>t<17>|_| |_|j}tj||j|j|j|jtjf|<0F>d<04>|_ |jdk r<>|j <20>!|j<16>d|_"|j#d|_#dS)Ncs&<00><00>}|dk r"|j|j|_d|_dS)NF)<04>_labelsep_inches<65>dpir<00> _initialized)<02>fig<69> self_weakref)<01> weak_self<6C><00>9/tmp/pip-install-i8dhxrtk/matplotlib/matplotlib/quiver.py<70> on_dpi_changesz)QuiverKey.__init__.<locals>.on_dpi_change<67> dpi_changed)<04>textZhorizontalalignmentZverticalalignmentrFg<46><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?)$<24>martist<73>Artist<73>__init__<5F>Q<>X<>Y<>Ur<00>coordr<00>labelr<00>ax<61>figurerr<00>weakref<65>ref<65> callbacks<6B>connect<63>_cidrr<00>dictr<00>kw<6B>mtextZText<78>halign<67>valignrZFontPropertiesr%<00> set_colorrZzorder)<10>selfr)r*r+r,r.rrrrrrrr7r#<00>_fpr!)r r"r(s: 
  


zQuiverKey.__init__cCs*|jjjj<03>|j<05>d|_tj<07>|<00>dS)z,
Overload the remove method
N) r)r/r0r3<00>
disconnectr5r&r'<00>remove)r<r!r!r"r?5szQuiverKey.removecCsD|jjs|j<00><02>|<00><03>|jj}|j|j|j_|jj}tj|j_|j t
<EFBFBD> t
<EFBFBD> |j <0A><01>}|j t
<EFBFBD>t
<EFBFBD> |j <0A><01>}t|jjt<11>r<>|jjnd}|j<00>t
<EFBFBD>|g<01>t
<EFBFBD>|g<01>|<05>|_||j_||j_|jj}|<06>|j<17>tj|jf|j|jfg|<00><1C>d<02>|<06><02>|_|jdk <09>r|j<1D>|j<1E>|j<1D> |j<00><1C><00>|j<1D>!|<00>"<22><00>d|_dS)N<>uv)<02>offsets<74> transOffsetT)#r)r<00>_init<69>_set_transform<72>pivotr<00>Umaskr<00>nomaskr,<00>np<6E>cos<6F>radiansr<00>sin<69>
isinstance<EFBFBD>angles<65>str<74> _make_verts<74>array<61>verts<74>polykw<6B>updater7<00> mcollections<6E>PolyCollectionr*r+<00> get_transform<72>vectorrr;<00> set_transform<72>
set_figureZ
get_figure)r<<00>_pivotZ_mask<73>u<>vrr7r!r!r"rC@s4

  

 zQuiverKey._initcCs0|jdkr||jS|jdkr(||jS|SdS)Nr r)rr)r<<00>xr!r!r"<00>_text_x^s




zQuiverKey._text_xcCs0|jdkr||jS|jdkr(||jS|SdS)Nr r )rr)r<<00>yr!r!r"<00>_text_yfs




zQuiverKey._text_ycCsh|<00><00>|j<01>|<01>|<00><03><00>|j|jf<02>\}}|j<07>|<00> |<02><01>|j<07>
|<00> |<03><01>|j<07>|<01>d|_ dS)NF) rCrW<00>drawrV<00>transform_pointr*r+r%Zset_xr^Zset_yr`<00>stale)r<<00>rendererr]r_r!r!r"rans  zQuiverKey.drawcCs<>|jdkr|<00>|jjj<04>n`|jdkr8|<00>|jjj<05>nD|jdkrV|<00>|jjjj<07>n&|jdkrt|<00>|jjjj<08>nt d<05><01>dS)N<>datarr0<00>incheszunrecognized coordinates)
r-rXr)r/<00> transDataZ transAxesr0Z transFigureZdpi_scale_trans<6E>
ValueError)r<r!r!r"rDxs



zQuiverKey._set_transformcCstj<01>||<01>|j<03>|<01>dS)N)r&r'rYr%)r<rr!r!r"rY<00>szQuiverKey.set_figurecCs0|j<00>|<01>ds |j<02>|<01>dr(difSdifS)NrTF)r%<00>containsrW)r<Z
mouseeventr!r!r"ri<00>szQuiverKey.contains)<14>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r9r:rEr(r?<00>_quiverkey_docrCr^r`r&<00>allow_rasterizationrarDrYriZ quiverkey_docr!r!r!r"r<00>s . 
 rc Gs$d}}}}}t|<00>}t|<00>dks4t|<00>dkrDt<02>|<00>d<03><01>}t<02>|<00>d<03><01>}t<02>|<00>d<03><01>}tj|||d<04>|jdkr<>d|jd}}n
|j\}}t|<00>dkr<>dd <09>|D<00>\}}t|<01>|kr<>t|<02>|kr<>d
d <09>t<02> ||<02>D<00>\}}n*t<02> t<02>
|<07>t<02>
|<06><01>}d d <09>|D<00>\}}|||||fS) N<><00><00><><EFBFBD><EFBFBD><EFBFBD>)r,<00>V<>C<>r<00>cSsg|]}t<00>|<01><01><02><00>qSr!)rHrP<00>ravel)<02>.0<EFBFBD>ar!r!r"<00>
<listcomp><3E>sz_parse_args.<locals>.<listcomp>cSsg|] }|<01><00><00>qSr!)rw)rxryr!r!r"rz<00>scSsg|]}t<00>|<01><01>qSr!)rHrw)rxryr!r!r"rz<00>s) <0B>list<73>lenrH<00>
atleast_1d<EFBFBD>poprZ_check_not_matrix<69>ndim<69>shapeZmeshgrid<69>arange) <09>argsr*r+r,rsrt<00>nr<6E>ncZ indexgridr!r!r"<00> _parse_args<67>s"

 r<>cGs&dd<02>|D<00>}t|<01>dkr"td<04><01>dS)NcSsh|]
}|j<00>qSr!)r<>)rxryr!r!r"<00> <setcomp><3E>sz+_check_consistent_shapes.<locals>.<setcomp>ruz/The shapes of the passed in arrays do not match)r|rh)ZarraysZ
all_shapesr!r!r"<00>_check_consistent_shapes<65>s r<>c@s<>eZdZdZdZe<05>e<07>ddddddddd dd
d d <0C> d d<0E><02>Ze j
ddd<11>e dd<13><00><01>Z e <09>
d<0F>e dd<15><00><01>Z e <09>
d<0F>e dd<17><00><01>Zdd<19>Zdd<1B>Zdd<1D>Zejdd<1F><00>Zd,d d!<21>Zd"d#<23>Zd$d%<25>Zd-d&d'<27>Zd(d)<29>Zd*d+<2B>ZeZdS).<2E>Quiverar
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.
)rrrNrprqg@ru<00>widthr@<00>kr) <0C>scale<6C> headwidth<74>
headlength<EFBFBD>headaxislength<74>minshaft<66> minlength<74>units<74> scale_unitsrMr<>rrEc s<||_t|<0E>\}}}}}||_||_t<04>||f<02>|_t|<10>|_||_ ||_
t |<04>|_ ||_ ||_||_||_| |_|
|_| |_| <0A><14>dkr<>d} | <0A><14>|_tj|j|jd<03>|<0F>d|j<1A>|_|<0F>d| <0C>|<0F>dd<07>tjj|gf|j|jdd <09>|<0F><02>||_ |<00>!|||<14>d|_"t#<23>$|<00><01><00>fd
d <0B>}|jj%j&<26>'d |<15>|_(d S)z<>
The constructor takes one required argument, an Axes
instance, followed by the args and kwargs described
by the following pyplot interface documentation:
%s
Zmidr)rE<00> transform<72>
facecolorsZ
linewidths)rF)rArB<00>closedcs<00><00>}|dk rd|_d|_dS)NTF)<02>_new_UVr)rr)r r!r"r#<00>sz&Quiver.__init__.<locals>.on_dpi_changer$N))r/r<>r*r+rH<00> column_stack<63>XYr|r r<>r<><00>floatr<74>r<>r<>r<>r<>r<>rMr<><00>lowerrErZ_check_in_list<73> _PIVOT_VALSr~rgr<><00>
setdefaultrTrUr(rR<00>set_UVCrr1r2r0r3r4r5)r<r/r<>r<>r<>r<>r<>r<>r<>r<>rMr<>rrEr<>r7r*r+r,rsrtr#r!)r r"r(<00>sD 

 
  

zQuiver.__init__z3.1zget_facecolor())<01> alternativecCs|<00><00>S)N)Z get_facecolor)r<r!r!r"rsz Quiver.colorcCsdS)Nr!)r<r!r!r"<00>keyvec
sz Quiver.keyveccCsdS)Nr!)r<r!r!r"<00>keytextszQuiver.keytextcCs(|jjj<02>|j<04>d|_tj<06>|<00>dS)z,
Overload the remove method
N)r/r0r3r>r5rTrUr?)r<r!r!r"r?sz Quiver.removecCs<>|<00><00>}|j}|<01><02><00>|jj|jjf<02>\}}||_|jdkrbt<08> t
<EFBFBD> |j <0C>dd<03>}d|j||_|j s<>|jdkr<>|<00>|j|j|j<12>d|_ dS)z]
Initialization delayed until first draw;
allow time for axes setup.
N<><00>g<><1E><>Q<EFBFBD><51>?T)rDr/<00>invertedrb<00>bboxr<78><00>height<68>spanrH<00>clip<69>math<74>sqrtr rr<>rOr,rsrM)r<<00>transr/ZsxZsy<73>snr!r!r"rCs
z Quiver._initcCsH|<00><00>}|<00><01>}||||}|<04>|j<03>}tj<05><06>}|j|dd<02>|S)NT)<01>ignore)rVZget_offset_transformr<6D>r<><00>
transformsZBbox<6F>nullZupdate_from_data_xy)r<rgr<>rBZfull_transformr<6D>r<>r!r!r"<00> get_datalim5s 
zQuiver.get_datalimcCsH|<00><00>|<00>|j|j|j<04>}|j|dd<02>d|_tj<08> ||<01>d|_
dS)NF)r<>) rCrOr,rsrM<00> set_vertsr<73>rTrUrarc)r<rdrQr!r!r"ra>s z Quiver.drawcCs<>tj|dd<02><02><02>}tj|dd<02><02><02>}tj|j|jddd<04>}|dk r<>tj|dd<02><02><02>}tj||jddd<04>}|tjkr||<03><06>}ntj||dd<05>}|<01>d<06>|_|<02>d<06>|_ ||_
|dk r<>|<00> |<03>d|_ d|_ dS)NT)<01>copyF)r<><00>shrink)<02>maskr<6B>ru)r<00>masked_invalidrwZmask_orr<72>rG<00>filledrPr,rsrF<00> set_arrayr<79>rc)r<r,rsrtr<>r!r!r"r<>Gs 

  
zQuiver.set_UVCc
Cs<>|j}|dkr<>|dkr(|jj}|jj}nR|dkrB|jj}|jj}n8|jj}|jj}|jj}|jj}t<05>||<08>}t<05>||<07>}||} nL|dkr<>|jj} n:|dkr<>|jj} n(|dkr<>d} n|dkr<>|jj} nt d <09><01>| S)
zK
Return a scale factor for converting from units to pixels
)r]r_<00>xyr]r_r<>r<><00>dotsg<00>?rfzunrecognized units)
r/ZviewLimr<6D>r<>r<>rH<00>hypotr0rrh)
r<r<>r/Zdx0Zdx1Zdxx0Zdxx1Zdyy0Zdyy1<79>dxr!r!r"<00>_dots_per_unit\s2

  



zQuiver._dots_per_unitcCs.|<00>|j<01>}||_t<03><04><00>|<01>}|<00>|<02>|S)zf
Sets the PolygonCollection transform to go
from arrow width units to pixels.
)r<>r<><00> _trans_scaler<65><00>Affine2Dr<44>rX)r<r<>r<>r!r!r"rD}s
 
zQuiver._set_transformc
Csz|jj<01>|j<03>}t<04>||f<02>}|jj<01>|j||<00>}||}t<04>|dd<00>df|dd<00>df<00>}tj|j<08>|} || fS)Nrur) r/rgr<>r<>rHr<><00>arctan2r<32><00>T)
r<r,rs<00>epsr<73>r@ZxypZdxyrM<00>lengthsr!r!r"<00>_angles_lengths<68>s$zQuiver._angles_lengthscCs||d}t|t<01>r|nd}|dkrF|jdkrF|j||dd<05>\}}n>|dksX|jdkr<>t<04>|jjj<08><01> <09>d}|j|||d<05>\}}|r<>|jdkr<>|}n
t<04>|<04>}|j
dkr<>t dt <0B> |j <0A><01>} |jtjk r<>||j<00><11>}
n|<08><11>}
d|
| |j} |jdk<08>r|j
dk<08>r| |_
d } n>|jdk<02>r,d} n |<00>|j<02>} | |j} |j
dk<08>rX| | |_
|| |j
|j}|<00>|<0E>\}}|dk<02>r<>|}n,|d
k<02>r<>t<04>|<04>}nt<0F>t<04>|<03><01><01>d <0B>}|<11>d <0C>}||dt<04>d|<00>|j}tj|j|jfd d<0E>}|jtjk <09>rt<0F> |<13>}tj!||j<|S)Ny<00>?<3F>r<>ru)r<>g<><67><EFBFBD><EFBFBD>MbP?<3F>
g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<00>?r@r)rrrurv)<01>axis)"rLrNr<>r<>rH<00>absr/ZdataLimZextents<74>maxr<78>r<>r<>r rFrrGZmeanr<6E>r<>r<>r<><00> _h_arrowsrr<>Zdeg2radr<64><00>reshape<70>exp<78>stack<63>real<61>imagrPZmasked)r<r,rsrMr@Z
str_anglesr<EFBFBD>r<>ryr<>Zameanr<6E>Zwidthu_per_lenur<75><00>lengthr*r+<00>thetar<61>r<>r!r!r"rO<00>sP 

     
 


 
 
 zQuiver._make_vertscCs|j|j}t|<01>}|<01>|d<01>}tj|dd|d<04>t<04>d|j |j dgtj<08>}|t<04>ddddg<04>|}dt<04>dd|j dgtj<08>}tj
|tj dd<06>f|dd<07>}t<04>d||j||j|gtj<08>}dt<04>dd|j dgtj<08>}dddd ddddg}|dd<06>|f} |dd<06>|f}
|
dd<06>d d
<EFBFBD>fd
9<||} ||} | d d
<EFBFBD>d
9<|d k<03>rh||nd } | | tj dd<06>f} | | tj dd<06>f} tj
||kd dd<07>}tj | | |d <0A>tj |
| |d <0A>|j dk<02>r<>| d| dd<06>d tj f8} nB|j dk<02>r| | dd<06>d tj f} n|j dk<03>r8td<11>|j <0A><01><01>||jk}|<0F><11><00>r<>t<04>dd dtj<08>tjd}t<04>|<10>|jd}t<04>|<10>|jd}tj
|tj dd<06>f|dd<07>}tj
|tj dd<06>f|dd<07>}t<04>
|d d<01>}tj | ||d <0A>tj |
||d <0A>| |
fS)z length is in arrow width units ruri)<01>outg<00>?N)r<>rvrprrgr<>)<01>whererrrzCQuiver.pivot must have value in {{'middle', 'tip', 'tail'}} not {0}g@)r<>r<>r|r<>rHr<>rPr<>Zfloat64r<34><00>repeatZnewaxisZcopytorErh<00>formatr<74><00>anyr<79><00>pirIrK)r<r<>Zminshr r]r_Zx0Zy0<79>iir*r+ZX0ZY0r<30><00>shortZtooshort<72>th<74>x1<78>y1ZX1ZY1r!r!r"r<><00>sX   
   


zQuiver._h_arrows)N)ru)rjrkrlrmr<>rZ Substitution<6F> _quiver_docr(r<00>
deprecated<EFBFBD>propertyrr<>r<>r?rCr<>r&rorar<>r<>rDr<>rOr<>Z
quiver_docr!r!r!r"r<><00>s.8 
 
!
:=r<>a<>
Plot a 2D field of barbs.
Call signature::
barbs([X, Y], U, V, [C], **kw)
Where *X*, *Y* define the barb locations, *U*, *V* define the barb
directions, and *C* optionally sets the color.
All arguments may be 1D or 2D. *U*, *V*, *C* may be masked arrays, but masked
*X*, *Y* are not supported at present.
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::
: /\ \
: / \ \
: / \ \ \
: / \ \ \
: ------------------------------
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.
See also https://en.wikipedia.org/wiki/Wind_barb.
Parameters
----------
X, Y : 1D or 2D array-like, optional
The x and y coordinates of the barb locations. See *pivot* for how the
barbs are drawn to the x, y positions.
If not given, they will be generated as a uniform integer meshgrid based
on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D
using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``
must match the column and row dimensions of *U* and *V*.
U, V : 1D or 2D array-like
The x and y components of the barb shaft.
C : 1D or 2D array-like, optional
Numeric data that defines the barb colors by colormapping via *norm* and
*cmap*.
This does not support explicit colors. If you want to set colors directly,
use *barbcolor* instead.
length : float, default: 7
Length of the barb in points; the other parts of the barb
are scaled against this.
pivot : {'tip', 'middle'} or float, default: 'tip'
The part of the arrow that is anchored to the *X*, *Y* grid. The barb
rotates about this point. This can also be a number, which shifts the
start of the barb that many points away from grid point.
barbcolor : color or color sequence
Specifies the color of all parts of the barb except for the flags. This
parameter is analogous to the *edgecolor* parameter for polygons,
which can be used instead. However this parameter will override
facecolor.
flagcolor : color or color sequence
Specifies the color of any flags on the barb. This parameter is
analogous 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 : dict, optional
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 : bool, default: False
Whether the empty barbs (circles) that are drawn should be filled with
the flag color. If they are not filled, the center is transparent.
rounding : bool, default: True
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.
barb_increments : dict, optional
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 : bool or array-like of bool, default: False
Whether the lines and flags should point opposite to normal.
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).
A single value is applied to all barbs. Individual barbs can be flipped by
passing a bool array of the same size as *U* and *V*.
Returns
-------
barbs : `~matplotlib.quiver.Barbs`
Other Parameters
----------------
**kwargs
The barbs can further be customized using `.PolyCollection` keyword
arguments:
%(PolyCollection)s
)<01> barbs_docc @s\eZdZdZejdddddddddd<07> dd <09><02>Zdd d<0E>Zdd<10>Zddd<12>Z dd<14>Z
e Z dS)<17>Barbsa>
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.
r<00>NFT) rEr<><00> barbcolor<6F> flagcolor<6F>sizes<65>
fill_empty<EFBFBD>barb_increments<74>rounding<6E> flip_barbc Os2|pt<00>|_||_|pt<00>|_| |_t<05>|
<EFBFBD>|_| <0C>d|j <09>} ||_
||_ |}|}d||fkr<>d| d<|rt|| d<q<>|r<>|| d<q<>| <0C> dd<06>n|| d<|| d<d| kr<>d| kr<>d | d<t | <0B>\}}}}}||_||_t<05>||f<02>}|j d
d }tjj|g|ff|| d <0C>| <0C><02>|<00>t<15><16><00>|<00>|||<12>dS) z<>
The constructor takes one required argument, an Axes
instance, followed by the args and kwargs described
by the following pyplot interface documentation:
%(barbs_doc)s
r<>N<>faceZ
edgecolorsr<EFBFBD>r<>Z linewidthZlwrurv<00>)rArB)r6r<>r<>r<>r<>rHr}<00>flipr~rgrZ<00>_lengthr<68>r<>r]r_r<>rTrUr(rXr<>ZIdentityTransformr<6D>)r<r/rEr<>r<>r<>r<>r<>r<>r<>r<>r<>r7r<>r]r_r[r\<00>cr<63>Z barb_sizer!r!r"r(<00>s>    

zBarbs.__init__rqr<><00>2c
Cs||r|||d<00>t<01>}t<02>||<00><01>t<01>}||}t<02>||<00><01>t<01>}||}||k}||dkB|dkB} |||| fS)aZ
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 (i.e., >= 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<00>?r)Zastype<70>intrH<00>floor)
r<Zmagr<67><00>half<6C>full<6C>flagZ num_flagsZnum_barbZ half_flag<61>
empty_flagr!r!r"<00> _find_tails<6C>szBarbs._find_tailsc  Csx|| <09>dd<02>} || <09>dd<04>} || <09>dd<06>}|| <09>dd<08>}td | d
d <0B>}d }y t|<08>}Wn tk
r<EFBFBD>||<08><04>}YnXt<05>||<01>tjd  }t d |d<0E><02>
<EFBFBD>}|
r<EFBFBD>|}nt<07> ||ddd<10>f<02>}g}<16>x<>t<07> |<13>D<00>]<5D>\}}||r<>|<16> |<15>q<>||fg}|}| |<00>r| n| }xpt||<00>D]`}||k<03>rH|| d
7}|<19>|||g||||d |g||||gg<03>||| 8}<1A>q.WxRt||<00>D]B}|<19>|||f|||||d f|||fg<03>|| 8}<1A>q<>W||<00>rP||k<02>r|<19> |||f<02>|d| 8}|<19>|||f||d |||df|||fg<03>t<10><11><00>| <00><01>|<19>}|<16> |<19>q<>W|S)a<>
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
'tip' and 'middle'. Can also be a number, which shifts the start
of the barb that many points from the origin.
*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.
<20>spacingg<00>?r<>g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?r<>g<00>?Z emptybarbg333333<33>?gg@)rrrv)rr)ZradiusNrrg<00>?r<>)<14>getr6r<>rhr<>rr<>rHr<>rZ get_vertsZ concatenateZ ndenumerate<74>append<6E>range<67>extendr<64>r<><00>rotater<65>)r<r[r\ZnflagsZnbarbsZ half_barbr<62>r<>rEr<>r<>r<>r<>Z full_heightZ
full_widthZ empty_radZ pivot_pointsZendxZendyrM<00>circZ
empty_barbZ barb_list<73>indexrZ
poly_verts<EFBFBD>offsetZ barb_height<68>ir!r!r"<00> _make_barbssb1 


 



 
zBarbs._make_barbsc Cs|tj|dd<02><02><02>|_tj|dd<02><02><02>|_t|j<06>dkrJt<07>|j|jj <09>}n|j}|dk r<>tj|dd<02><02><02>}t
<EFBFBD> |j <0C><02>|j <0A><02>|j|j||<04><02><00>\}}}} }}t|||| ||<04>n@t
<EFBFBD> |j <0C><02>|j <0A><02>|j|j|<04><02><00>\}}}} }t|||| |<04>t<07>|| <09>}
|j|
|jf|j<12>\} } } }|<00>|| | | | ||j|j|j|j|<04> }|<00>|<0F>|dk <09>r^|<00>|<05>t<07>||f<02>}||_d|_dS)NF)r<>ruT)rr<>rwr[r\r|r<>rHZ broadcast_tor<6F>r<00>delete_masked_pointsr]r_r<>r<>r<>r<>r<>r<>r<>rZr<>r<>r<>r<>r<>Z_offsetsrc)r<r,rsrtr<>r<>r]r_r[r\Z magnitude<64>flagsZbarbsZhalves<65>emptyZ
plot_barbsr<EFBFBD>r!r!r"r<><00>s6,  



z Barbs.set_UVCcCs<>|dd<01>df|_|dd<01>df|_t<02>|j<00><04>|j<01><04>|j|j<06>\}}}}t||||<05>t<08> ||f<02>}t
j <0B> ||<01>d|_ dS)z<>
Set the offsets for the barb polygons. This saves the offsets passed
in and masks them as appropriate for the existing U/V data.
Parameters
----------
xy : sequence of pairs of floats
NrruT)r]r_rrrwr[r\r<>rHr<>rTrU<00> set_offsetsrc)r<r<>r]r_r[r\r!r!r"r<00>s $zBarbs.set_offsets)Trqr<>r<>)N) rjrkrlrmr<00>interpdr(r<>r<>r<>r<00>
_barbs_docr<EFBFBD>r!r!r!r"r<><00>s 8

,r<>)$rmr<>r1ZnumpyrHrZ
matplotlibrrrZmatplotlib.artistZartistr&Zmatplotlib.collections<6E> collectionsrTZmatplotlib.patchesrZmatplotlib.textr%r8Zmatplotlib.transformsr<73>r<00>paramsr<73>rnr'rr<>r<>rUr<>rrSr<>r!r!r!r"<00><module>s0       Aa