Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/quiver.cpython-312.pyc
T

754 lines
55 KiB
Plaintext
Raw Normal View History

Ë
†Rj$¾ãóØdZddlZddlZddlmZddlmZmZmZddl m
Z ddl m
ZddlmZddlmZddlmZdej,j.zZej,j3e¬«Gdd e j4«Zd
d œd Zd
ZGddej<«Zdej,j.zZ ej,j3e ¬«Gddej<«Z!y)
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.
éN)Úma)Ú_apiÚcbookÚ
_docstring)Ú
CirclePolygonu¨%
Plot a 2D field of arrows.
Call signature::
quiver([X, Y], U, V, [C], /, **kwargs)
*X*, *Y* define the arrow locations, *U*, *V* define the arrow directions, and
*C* optionally sets the color. The arguments *X*, *Y*, *U*, *V*, *C* are
positional-only.
**Arrow length**
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 arrow shape is determined by *width*, *headwidth*, *headlength* and
*headaxislength*. See the notes below.
**Arrow styling**
Each arrow is internally represented by a filled polygon with a default edge
linewidth of 0. As a result, an arrow is rather a filled area, not a line with
a head, and `.PolyCollection` properties like *linewidth*, *edgecolor*,
*facecolor*, etc. act accordingly.
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. The interpretation
of these components (in data or in screen space) depends on *angles*.
*U* and *V* must have the same number of elements, matching the number of
arrow locations in *X*, *Y*. *U* and *V* may be masked. Locations masked
in any of *U*, *V*, and *C* will not be drawn.
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. The size of *C* must match the number of arrow
locations.
angles : {'uv', 'xy'} or array-like, default: 'uv'
Method for determining the angle of the arrows.
- 'uv': Arrow directions are based on
:ref:`display coordinates <coordinate-systems>`; i.e. a 45° angle will
always show up as diagonal on the screen, irrespective of figure or Axes
aspect ratio or Axes data ranges. This is useful when the arrows represent
a quantity whose direction is not tied to the x and y data coordinates.
If *U* == *V* the orientation of the arrow on the plot is 45 degrees
counter-clockwise from the horizontal axis (positive to the right).
- 'xy': Arrow direction in data coordinates, i.e. the arrows point from
(x, y) to (x+u, y+v). This is ideal for vector fields or gradient plots
where the arrows should directly represent movements or gradients in the
x and y directions.
- 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.
For example, ``angles=[30, 60, 90]`` will orient the arrows at 30, 60, and 90
degrees respectively, regardless of the *U* and *V* components.
Note: inverting a data axis will correspondingly invert the
arrows only with ``angles='xy'``.
pivot : {'tail', 'mid', 'middle', 'tip'}, 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'.
scale : float, optional
Scales the length of the arrow inversely.
Number of data values represented by one unit of arrow length on the plot.
For example, if the data represents velocity in meters per second (m/s), the
scale parameter determines how many meters per second correspond to one unit of
arrow length relative to the width of the plot.
Smaller scale parameter makes the arrow longer.
By default, an autoscaling algorithm is used to scale the arrow length to a
reasonable size, which is 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'}, default: 'width'
The physical image unit, which is used for rendering the scaled arrow data *U*, *V*.
The rendered arrow length is given by
length in x direction = $\frac{u}{\mathrm{scale}} \mathrm{scale_unit}$
length in y direction = $\frac{v}{\mathrm{scale}} \mathrm{scale_unit}$
For example, ``(u, v) = (0.5, 0)`` with ``scale=10, scale_units="width"`` results
in a horizontal arrow with a length of *0.5 / 10 * "width"*, i.e. 0.05 times the
Axes width.
Supported values are:
- 'width' or 'height': The arrow length is scaled relative to the width or height
of the Axes.
For example, ``scale_units='width', scale=1.0``, will result in an arrow length
of width of the Axes.
- 'dots': The arrow length of the arrows is in measured in display dots (pixels).
- 'inches': Arrow lengths are scaled based on the DPI (dots per inch) of the figure.
This ensures that the arrows have a consistent physical size on the figure,
in inches, regardless of data values or plot scaling.
For example, ``(u, v) = (1, 0)`` with ``scale_units='inches', scale=2`` results
in a 0.5 inch-long arrow.
- 'x' or 'y': The arrow length is scaled relative to the x or y axis units.
For example, ``(u, v) = (0, 1)`` with ``scale_units='x', scale=1`` results
in a vertical arrow with the length of 1 x-axis unit.
- 'xy': Arrow length will be same as 'x' or 'y' units.
This is useful for creating vectors in the x-y plane where u and v have
the same units as x and y. 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``.
Note: Setting *scale_units* without setting scale does not have any effect because
the scale units only differ by a constant factor and that is rescaled through
autoscaling.
units : {'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, default: 'width'
Affects the arrow size (except for the length). In particular, the shaft
*width* is measured in multiples of this unit.
Supported values are:
- 'width', 'height': The width or height of the Axes.
- '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 following table summarizes how these values affect the visible arrow
size under zooming and figure size changes:
================= ================= ==================
units zoom figure size change
================= ================= ==================
'x', 'y', 'xy' arrow size scales —
'width', 'height' — arrow size scales
'dots', 'inches' — —
================= ================= ==================
width : float, optional
Shaft width in arrow units. All head parameters are relative to *width*.
The 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, default: 3
Head width as multiple of shaft *width*. See the notes below.
headlength : float, default: 5
Head length as multiple of shaft *width*. See the notes below.
headaxislength : float, default: 4.5
Head length at shaft intersection as multiple of shaft *width*.
See the notes below.
minshaft : float, 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, 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.
color : :mpltype:`color` or list :mpltype:`color`, 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
----------------
data : indexable object, optional
DATA_PARAMETER_PLACEHOLDER
**kwargs : `~matplotlib.collections.PolyCollection` properties, optional
All other keyword arguments are passed on to `.PolyCollection`:
%(PolyCollection:kwdoc)s
Returns
-------
`~matplotlib.quiver.Quiver`
See Also
--------
.Axes.quiverkey : Add a key to a quiver plot.
Notes
-----
**Arrow shape**
The arrow is drawn as a polygon using the nodes as shown below. The values
*headwidth*, *headlength*, and *headaxislength* are in units of *width*.
.. image:: /_static/quiver_sizes.svg
:width: 500px
The defaults give a slightly swept-back arrow. Here are some guidelines how to
get other head shapes:
- 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 proportionally.
- To remove the head completely, set all *head* parameters to 0.
- To get a diamond-shaped head, make *headaxislength* larger than *headlength*.
- Warning: For *headaxislength* < (*headlength* / *headwidth*), the "headaxis"
nodes (i.e. the ones connecting the head with the shaft) will protrude out
of the head in forward direction so that the arrow head looks broken.
)Ú
quiver_docc ó¶eZdZdZdddddœZdddddœZddd d
dœZd d d
ddd
d
d
dœˆfd
Zed«Z dZ
dZ e jd«ZdZˆfdZdZˆxZS)Ú QuiverKeyz2Labelled arrow for use as a quiver plot scale key.ÚcenterÚleftÚright©ÚbottomÚtopÚmiddleÚtipÚtailrÚaxesNçš™™™™™¹?r)ÚangleÚ coordinatesÚcolorÚlabelsepÚlabelposÚ
labelcolorÚfontpropertiesÚzorderc óHt|«||_||_||_||_||_||_||_||_ | |_
|
|_ | |_ | xs
t«|_||_t!j"||j$|j|j&|j|j¬«|_|j%|j(j+|j«d|_|
|
|_y|j.dz|_y)a
Add a key to a quiver plot.
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.
Parameters
----------
Q : `~matplotlib.quiver.Quiver`
A `.Quiver` object as returned by a call to `~.Axes.quiver()`.
X, Y : float
The location of the key.
U : float
The length of the key.
label : str
The key label (e.g., length and units of the key).
angle : float, default: 0
The angle of the key arrow, in degrees anti-clockwise from the
horizontal axis.
coordinates : {'axes', 'figure', 'data', 'inches'}, default: 'axes'
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 : :mpltype:`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 : float, default: 0.1
Distance in inches between the arrow and the label.
labelcolor : :mpltype:`color`, default: :rc:`text.color`
Label color.
fontproperties : dict, optional
A dictionary with keyword arguments accepted by the
`~matplotlib.font_manager.FontProperties` initializer:
*family*, *style*, *variant*, *size*, *weight*.
zorder : float
The zorder of the key. The default is 0.1 above *Q*.
**kwargs
Any additional keyword arguments are used to override vector
properties taken from *Q*.
)ÚtextÚhorizontalalignmentÚverticalalignmentr Nr)ÚsuperÚ__init__ÚUrÚcoordrÚlabelÚ_labelsep_inchesrrÚdictr ÚkwÚmtextÚTextÚhalignÚvalignr#Ú set_colorÚ_dpi_at_last_initr!)Úselfr(r)r*r+r-rrrrrrr r!ÚkwargsÚ __class__s €úT/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/quiver.pyr'zQuiverKey.__init__ø€ôj ÑÔØˆŒØˆŒØˆŒØˆŒØˆŒ
Ø ˆŒ
؈Œ
؈Œ
Ø (ˆÔà ˆŒ
،سˆÔ؈ŒÜ—J‘JØØ $§ ¡ ¨D¯M©MÑ :Ø"Ÿk™k¨$¯-©-Ñ׌ ð
?‰?Ð I‰I× Ñ  §¡Ô 0Ø!%ˆÔØ &Ð 2 ¸¿¹À3¹ˆ ócó||j|jjjd¬«jzS)NT©Úroot)r.r(rÚ
get_figureÚdpi©r7s r:rzQuiverKey.labelsepis/à×$ t§v¡v§{¡{×'=Ñ'=À4Ð'=Ó'H×'LÑ'LÑLr;cóº |jj|jjjd¬«jk7r|jj «|j
«tj|j|j|jtj¬«5|jtjtj |j"««z}|jtj$tj |j"««z}|jj'ddggtj(|g«tj(|g«d«|_ddd«|jj,}|j/|j0«t3j4|j*f|j6|j8fg|j;«dœ|¤Ž|_|j>%|j<jA|j>«|j<jC|jj;««|j<jE|j««|jjjd¬«j|_y#1swYŒKxYw)NTr=)ÚpivotÚUmaskçÚuv©ÚoffsetsÚoffset_transform)#r(r6rr?r@Ú_initÚ_set_transformrÚ _setattr_cmrCrrÚnomaskr+ÚnpÚcosÚradiansrÚsinÚ _make_vertsÚarrayÚvertsÚpolykwÚupdater0Ú mcollectionsÚPolyCollectionr)r*Ú
get_transformÚvectorrr5Ú
set_transformÚ
set_figure)r7Úvr8s r:rJzQuiverKey._initmØ Øv‰v×'¨4¯6©6¯;©;×+AÑ+AÀtÐ+AÓ+L×+PÑ+PÒ Ø × Ñ Ô ×" 4§6¡6°·±¸D¿M¹MÑ1Jä)+¯©ô
Tð—F‘FœRŸV™V¤B§J¡J¨t¯z©zÓ$:Ó;Ø—F‘FœRŸV™V¤B§J¡J¨t¯z©zÓ$:Ó;Ø!ŸV™V×/°"°b°°
Ü02·±¸!¸³
¼r¿x¹xÈÈ»}ÈdóT
÷ 
Tð—VV—]]ˆ M‰M˜$Ÿ'™'Ô &×
ðàŸ&™& $§&¡&Ð*Ø!%×!3Ñ!3Ó!5ñðñ ˆDŒKð
z‰zÐ ×% d§j¡jÔ K‰K× % d§f¡f×&:Ñ&:Ó&<Ô K‰K× " 4§?¡?Ó#4Ô 5Ø%)§V¡V§[¡[×%;Ñ%;ÀÐ%;Ó%F×%JÑ%Jˆ "÷%
Tñ
Tús
Â:C
KËKcó’d|j­fd|j f|j­df|j dfdœ|jS)Nrr)rrrAs r:Ú _text_shiftzQuiverKey._text_shift†sRàd—mmd—mm—==. —==. 
ð
-‰-ñ ð r;có`|j«|jj|«|j«j |j
|j f«}|jj||j«z«|jj|«d|_
y)NF) rJrZÚdrawrYÚ transformr)r*r#Ú set_positionr`Ústale)r7ÚrendererÚposs r:rbzQuiverKey.drawŽszà
Œ Ø ×јÔ× Ñ Ó"×,¨d¯f©f°d·f±fÐ-=Ó>ˆØ ×јs T×%5Ñ%5Ó%7Ñ  ؈
r;c óZ|jjjd¬«}|jt j
|jjj |jjj|j|jdœ|j¬««y)NFr=)ÚdatarÚfigureÚinches)r) r(rr?r[rÚ
check_getitemÚ transDataÚ transAxesÚ transFigureÚdpi_scale_transr,)r7Úfigs r:rKzQuiverKey._set_transform—sxØf‰fk‰k×$¨%ÐØ ×Ñœ4×—F‘F—K‘K×—F‘F—K‘K×—o‘oØ×/
ð
—z  $r;cóZt||«|jj|«y©N)r&r\r#)r7rqr9s €r:r\zQuiverKey.set_figure s"ø€Ü
ј3ÔØ ‰ ×јSÕ!r;có´|j|«rdifS|jj|«ds|jj|«drdifSdifS)NFrT)Ú_different_canvasr#ÚcontainsrZ)r7Ú
mouseevents r:rvzQuiverKey.contains¤s]Ø × !  ˜" ð
I‰I× Ñ ˜zÓ *¨1Ò  ×$ ZÓÒ˜8ˆOØbˆr;)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r3r4rCr'ÚpropertyrrJr`ÚmartistÚallow_rasterizationrbrKr\rvÚ
__classcell__©r9s@r:r
r
s—ø„Ù (°¸gÑ
F€FØ %¨h¸
F€FØ °¸FÑ C€Eð¨°tÀcب$¸tØöLGð\ñMóðMòKò2ð
× Ñ ñóòr;r
Úfunction)Ú caller_namecóldx}x}}t|«}|dk(rtj|Ž\}}no|dk(rtj|Ž\}}}nS|dk(rtj|Ž\}}}}n6|dk(rtj|Ž\}}}}}ntj|d|¬«|j
dk(rd|j d fn |j \}} |š|j«}|j«}t|«| k(r/t|«|k(r!d
tj||«D«\}}n…t|«t|«k7rntd |jd |jd
«tjtj| «tj|««}
d|
D«\}}|||||fS)a­
Helper function to parse positional parameters for colored vector plots.
This is currently used for Quiver and Barbs.
Parameters
----------
*args : list
list of 2-5 arguments. Depending on their number they are parsed to::
U, V
U, V, C
X, Y, U, V
X, Y, U, V, C
caller_name : str
Name of the calling method (used in error messages).
éééz from 2 to 5)ÚtakesÚgivenérc3ó<K|]}|j«Œy­wrs)Úravel©Ú.0Úas r:ú <genexpr>z_parse_args.<locals>.<genexpr>Øsèø€Ò9 !A—GG—IÑ9ùsz-X and Y must be the same size, but X.size is z and Y.size is ú.c3óFK|]}tj|«Œy­wrs)rNrs r:rz_parse_args.<locals>.<genexpr>Þsèø€Ò˜ Ñ/ùs!) ÚlenrNÚ
atleast_1drÚ nargs_errorÚndimÚshaperŒÚmeshgridÚ
ValueErrorÚsizeÚarange) rÚargsr)r*Únargsr+ÚnrÚncÚ indexgrids r:Ú _parse_argsr£¯sð&ЀAЈˆAä ‹I€EØ ‚zô}‰}˜dÐ#‰ˆ‰1Ø Ü—-‘- Ð&‰ˆˆ1‰aØ Ü—]‘] DÐ)‰
ˆˆ1ˆa‘Ø ÜŸ
 ,‰
ˆˆ1ˆa‘Aä×ј{°-ÀuÔMà !§¡¨!¢ ˆa˜‰_°·±F€Bˆà€}Ø
G‰GIˆØ
G‰GIˆÜ ˆq6RŠ<œC F bšLÙ9¤r§{¡{°1°aÓ'8Ô9‰DˆA‰qÜ
V”s˜1“vÒ
Üð*Ø*+¯&©&¨°ÀÇÁÀÈðKóLð
Lô—K§ ¡ ¨"£
¬r¯y©y¸«}Ó=ˆ Ù/ YÔ/‰ˆˆ ˆaAqˆr;cór|Dchc]}|jŒ}}t|«dk7r td«ycc}w)NrŠz/The shapes of the passed in arrays do not match)r—r“r™)ÚarraysrÚ
all_shapess r:Ú_check_consistent_shapesr§ãs;Ø#)Ö*˜a!—'“'Ð*€JÐ
ˆ:ƒ˜!ÒÜÐùò+s4cóÈeZdZdZdZej e«ddddddddd dd
d d œ ˆfd
«ZdZ dZ
e jˆfd«Z
ddZdZdZddZdZdZˆxZS)Ú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.
)rrrNr…r‡g@rŠÚwidthrFÚkr) ÚscaleÚ headwidthÚ
headlengthÚheadaxislengthÚminshaftÚ minlengthÚunitsÚ scale_unitsÚanglesrªrrCc ó||_t|ddiŽ\}}}}}||_||_t j
||f«|_t|«|_||_ ||_
t|«|_ ||_
||_||_||_| |_|
|_| |_|
j)«dk(rd}
|
j)«|_t-j.|j0|j*¬«|j3d|j4«|_|j9d| «|j9dd «t;|xgf|j |j6d
d œ|¤Ž||_|jA|||«d |_!y )
The constructor takes one required argument, an Axes
instance, followed by the args and kwargs described
by the following pyplot interface documentation:
%s
rÚquiverÚmidr©rCrcÚ
facecolorsÚ
linewidths)rF)rHrIÚclosedN)"Ú_axesr£r)r*rNÚ column_stackÚXYr“rr­Úfloatr®r´ÚlowerrCrÚ
check_in_listÚ _PIVOT_VALSÚpoprmrcÚ
setdefaultr&r'rUÚset_UVCr6)r7Úaxr¬r­r´rrCr8r)r*r+rr9s €r:r'zQuiver.__init__ýsYø€ðˆŒ
Ü# @°xÑ@‰
ˆˆ1ˆaˆŒØˆŒÜ—/‘/ 1 a &ÓŒÜQ“ˆŒØˆŒ
Ø"ˆŒÜ 
ÓŒØÔØ ˆŒ
Ø"ˆŒØˆŒ
ØÔ؈Œ ؈Œ
à ;‰;‹=˜EÒ ˆEØ—[‘[“]ˆŒ
Ü ×ј4×+°4·:±:ÕŸ K°·±ÓŒØ×ј,¨Ô×ј,¨Ô
јð 1 T§W¡W¸t¿~¹~Ø %ñ 1Ø)/òˆŒ Ø ˜1ÔØ!%ˆÕr;có¤ |j«}|j«j|jj«j
|_|j
€Ktjtj|j«dd«}d|j z|z |_|j|jjd¬«jk7rH|j€<|j!|j"|j$|j&|j(«|jjd¬«j|_ y)z]
Initialization delayed until first draw;
allow time for axes setup.
TNéég¸…ëQ¸®?r=)rKÚinvertedÚtransform_bboxrÚbboxrªÚspanrNÚclipÚmathÚsqrtrr6r?r@rRr+r´)r7ÚtransÚsns r:rJz Quiver._init'ð Ø×)ˆŸÓ¿ ¹ ¿¹ÓMˆDŒIØz‰zЗW‘WœTŸY™Y t§v¡vÓ°2Ó6Ø! D§I¡IÑÑ2
ð×&¨$¯)©)×*>Ñ*>ÀDÐ*>Ó*I×*MÑ*MÒŸ
Ð× Ñ  §¡¨$¯&©&°$·&±&¸$¿+¹+ÔFà%)§Y¡Y×%9Ñ%9¸tÐ%9Ó%D×%HÑ%Hˆ "r;cóô|j«}|j«}||z
||z
z}|j|j«}tj
j
«}|j|d¬«|S)NT)Úignore)rYÚget_offset_transformrcÚ
transformsÚBboxÚnullÚupdate_from_data_xy)r7rmÚ
offset_trfÚfull_transformr¾s r:Ú get_datalimzQuiver.get_datalim<spØ×$ˆØ×0ˆ
Ø 
¸YÑ0FÑGˆØ
×
% d§g¡gÓ
Üר × Ñ  ¨DÐ Ôˆ r;cóð|j«|j|j|j|j|j
«}|j
|d¬«t|!|«d|_ y)NF))
rJrRr+r´Ú set_vertsr&rbre)r7rfrTr9s €r:rbz Quiver.drawEsUø€à
Œ Ø× Ñ  §¡¨$¯&©&°$·&±&¸$¿+¹+ÓFˆØ u UˆÔ
 ؈
r;c
órtj|d¬«j«}tj|d¬«j«}|%tj|d¬«j«}td|||f«D]Z\}}|Œ |j|j
k(rŒ#|jdk(rŒ3t
d|d|jd|j
d«tj|j|jd d¬
«}|^tj||jd d¬
«}|tjur|j«}ntj||d ¬ «}|jd«|_ |jd«|_
||_||j|«d|_y) NT©Úcopy)r+rz Argument z has a size z which does not match z, the number of arrow positionsF)Úshrink)Úmaskrá)rÚmasked_invalidrŒÚzipršrr™Úmask_orrãrMÚfilledrSr+rDÚ set_arrayre)r7r+rÚnameÚvarrãs r:zQuiver.set_UVCMsrô
× Ñ ˜a dÔ Ü × Ñ ˜a dÔ Ø ˆ=Ü×! !¨$Ô7ˆAܘ_¨q°!°Q¨iÓ C‰IˆDK 3§8¡8¨t¯v©vÓ#5¸¿¹ÀQ»Ü  9¨T¨F°,¸s¿x¹x¸jØ#9¸$¿&¹&¸ðBBð"BóCðCð Cô z‰z˜!Ÿ&™& !§&¡&¨u¸BˆØ ˆ—:‘:˜d A§F¡F°¸tÔDˆDØ”r—y‘yÑ Ø—H‘H“J‘ä—H‘H˜Q T°Ô6ؘ!“ˆŒØ˜!“ˆŒØˆŒ
Ø ˆ=Ø N‰N˜1Ô Øˆ
r;c óÒ|jj}|jj}tj|j
|j
z |j |j z tj|jŽtj|jŽz |j
|j d|jjd¬«jdœ|¬«S)z:Return a scale factor for converting from units to pixels.çð?Tr=)ÚxyrªÚheightÚdotsrk)) rÚviewLimrrlrNÚhypotršr?r@)r7ÚbbÚvls r:Ú_dots_per_unitzQuiver._dots_per_unithà
Y‰Y^‰^ˆØ
Y‰Y×
Ñ
ˆÜטBŸH™HјRŸY™YÑ—(‘(˜BŸG™GÐ$¤r§x¡x°·±Ð'9Ñ—X‘XØ—i‘iØØ—i‘i×Ð#
ðôð r;có²|j|j«}||_tj«j |«}|j
|«|S)zb
Set the PolyCollection transform to go
from arrow width units to pixels.
)Ú _trans_scalerÖÚAffine2Dr¬r[)r7ÚdxrÑs r:rKzQuiver._set_transformvsLð
×
Ñ
 §¡Ó
؈ÔÜ×+¨BÓØ ×ј5Ôˆ r;cóh|jjj|«}tj||f«}|jjj|||zz«}||z
}tj
|dddf|dddf«} tj |jŽ|z }
| |
fS)NrŠr)rrmrcrNÚarctan2róÚT) r7r+ÚepsrïrFÚxypÚdxyr´Úlengthss r:Ú_angles_lengthszQuiver._angles_lengthsØ
Y‰Y×
Ñ
×
*¨2Ó
.ˆÜ
_‰_˜a ˜
Øi‰i×+¨B°°r±©MÓØB‰hˆÜ˜C¢ 1 ™I sª1¨a¨4¡yÓ1ˆÜ—((˜CŸE™EÐ" (ˆØwˆÐr;cój||dzz}t|t«r|nd}|dk(r(|jdk(r|j|||d¬«\}}np|dk(s|jdk(r\t j
|j jj«j«dz}|j||||¬«\}}|r|jdk(r} nt j
|«} |j€‰tdtj|j««}
|jtj ur| |jj#«} n| j#«} d| z|
z|j$z } |j|j |_
d }
nR|jdk(rd}n|j'|j«}||j(z }
|j
 |
z|_
| |
|j|j*zz z}|j-|«\}}|dk(r|}nR|d
k(rt j.|«}n7tj0t j2|««j5d «}|j7d «}||dzzt j8d|z«z|j*z}t j:|j<|j>fd
¬«}|jtj ur2tj@|«}tjB||j<|S)Nyð?Ú)gü©ñÒMbP?é
gÍÌÌÌÌÌü?rìrFr)éÿÿÿÿrŠr„©Úaxis)"Ú
isinstanceÚstrr³rrNÚabsrÚdataLimÚextentsÚmaxr¬rrDrrMÚmeanrÍÚ _h_arrowsrÚdeg2radrçÚreshapeÚexpÚstackÚrealÚimagrSÚmasked)r7r+r´rFÚ
str_anglesrrÚameanr¬Úwidthu_per_lenurúÚlengthr)r*Úthetarïs r:rRzQuiver._make_vertsØ!b&‰jˆÜ)¨&´6V¸Bˆ
Ø ˜Ò  $×"2Ñ"2°dÒ":ð#×2°2°q¸ÐC‰OˆF‘GØ
˜
 4×#3Ñ#3°tÒ#;ô—&&˜Ÿ×*×9¸Aˆ"×2°2°q¸ÐE‰OˆF ˜$×*¨dÒ‰Aär“
ˆAà :‰:Ð ÜŸ 4§6¡6Ó+ˆBØz‰z¤§¡Ñ˜4Ÿ:™:˜+™×-‘àŸð˜%‘K $ t§y¡yÑ0ˆ × Ñ Ð z‰zÐ"
Ø!‰Oà×Ñ 4Òà××)9Ñ)9Ó:Ø  4×#4Ñ#4Ñ4ˆz‰zÐ" 4
د©°d·j±jÑ)@ÑØ~‰~˜fÓ%‰ˆˆ1Ø ˜Ò ؉EØ
˜
Ü—H‘H˜R“L‰Eä×%¤b§j¡j°Ó&8Ó9×ÓCˆ
˜&ˆØ!b&‰jœBŸF™F ¡:Ó
᱄
;ˆÜ
X‰Xr—w‘w §¡Ð(¨qÔ
1ˆØ :‰:œRŸY™YÑ ˜"“ˆŸY™YˆBˆtz‰z‰Nðˆ r;cóH|j|jz}t|«}|j|d«}t j
|dd|¬«t j d|j |j dgtj«}|t j gd¢«|zz}dt j dd|jdgtj«z}t j|tjddf|d¬«}t j d||jz
||jz
|gtj«}dt j dd|jdgtj«z}gd ¢}|dd|f} |dd|f}
|
ddd
d fxxd zcc<||} ||} | d
d xxxd zccc|d k7r||z nd }
|
| tjddfz} |
| tjddfz} t j||kd
d¬«}t j| | |¬«t j|
| |¬«|jdk(r| d| ddd
tjfzz} n]|jdk(r| | ddd
tjfz
} n2|jdk7r#tjgd¢|j¬«||j k}|j#«r%t j$dd
dtj«tj&dz z}t j(|«|j zdz}t j*|«|j zdz}t j|tjddf|d¬«}t j|tjddf|d¬«}t j|d
d«}t j| ||¬«t j|
||¬«| |
fS)zLength is in arrow width units.rŠri)Úout)rgà?Nr)rr„r…r„rrr…rrE)Úwhererrr)rrrr¸g@)r“rrNrSÚfloat64r­ÚrepeatÚnewaxisÚcopytorCrÚanyrÚpirOrQ)r7rÚminshrÚx0Úy0Úiir)r*ÚX0ÚY0râÚshortÚtooshortÚthÚx1Úy1ÚX1ÚY1s r:rzQuiver._h_arrowsÊs]ð

 §¡ÑÜ ‹KˆØ  1Óô ˜˜7¨Õ H‰Ha˜$×Ðð—Z
!ˆð
šÓÑ /ˆØ ”"—((˜A˜q $§.¡.°!Ð4´b·j±jÓ Ü I‰IŸ
¢A˜
Ñ°Ô 2ˆä
X‰Xq˜% $×"5Ñ"5јÑð7Ü8:¿
¹
óDˆà
”2—88˜Q  4§>¡>°1Ð5´r·z±zÓ
BˆÚ
%ˆØ
Šaˆe‰HˆØ
Šaˆe‰HˆØ Š!ˆQˆrˆTˆ'

Ø
‰VˆØ
‰VˆØ
ˆ1ˆR‹B‰Ø#(¨B¢;˜%’°BˆØ
Ÿ¢Q˜Ñ
'ˆØ
Ÿ¢Q˜Ñ
'ˆÜ ˜& 5™.¨!°!Ô4ˆä
!R˜
!R˜ :‰:˜Ò
˜AœrŸz™zÐ *‰AØ
Z‰Z˜
ðAa˜œBŸJ™JÐ'‰AØ
Z‰Z˜
× Ñ ÒÇ
Á
Õ ˜DŸN™NÑ*ˆØ <‰<˜1˜a ¤B§J¡JÓ/´2·5±5¸3±;Ñ?ˆBܘ˜dŸn™nÑ,¨sÑ2ˆBܘ˜dŸn™nÑ,¨sÑ2ˆBܘ2œbŸj™jª!˜mÑ,¨a°aÔ8ˆBܘ2œbŸj™jª!˜mÑ,¨a°aÔ8ˆBÜ—y‘y ¨1¨aÓ0ˆHÜ I‰Ia˜  I‰Ia˜  !ˆtˆ r;rs))rxryrzr{rÚ SubstitutionÚ _quiver_docr'rJr}r~rbrKrrRrrr€s@r:éø„ñð",€Kà€Z×ј q°QÀsØ q°ÀTØ ¸''&òRIò*ð
× Ñ óóóò6 ò óò;öz:r;aI
Plot a 2D field of wind barbs.
Call signature::
barbs([X, Y], U, V, [C], /, **kwargs)
Where *X*, *Y* define the barb locations, *U*, *V* define the barb
directions, and *C* optionally sets the color.
The arguments *X*, *Y*, *U*, *V*, *C* are positional-only and 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 : :mpltype:`color` or color sequence
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 : :mpltype:`color` or color sequence
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
----------------
data : indexable object, optional
DATA_PARAMETER_PLACEHOLDER
**kwargs
The barbs can further be customized using `.PolyCollection` keyword
arguments:
%(PolyCollection:kwdoc)s
)Ú barbs_docc óveZdZdZej
ddddddddddœ ˆfd
«Zd
d „Zd
Zdd Z ˆfd Z
ˆxZ S)Ú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