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

226 lines
27 KiB
Plaintext
Raw Normal View History

Ë
†Rj£Uãó¼ddlmZddlZddlZddlZddlmZmZddl m
Z
ddl m Z
ddlmZddlmZGddej(«ZGdd«ZGd „d
e«Zy) é)ÚMutableMappingN)Ú_apiÚ
_docstring)Úallow_rasterizationcóeZdZdZdZej ˆfd«ZdZdZ dZ
dZ ˆfdZ dˆfd „ Z
d
Zd Zd Zd
ZdZdZeˆfd«ZdZdZdZddZdZed«Zed«Zed«ZdZˆxZ S)ÚSpineay
An axis spine -- the line noting the data area boundaries.
Spines are the lines connecting the axis tick marks and noting the
boundaries of the data area. They can be placed at arbitrary
positions. See `~.Spine.set_position` for more information.
The default position is ``('outward', 0)``.
Spines are subclasses of `.Patch`, and inherit much of their behavior.
Spines draw a line, a circle, or an arc depending on if
`~.Spine.set_patch_line`, `~.Spine.set_patch_circle`, or
`~.Spine.set_patch_arc` has been called. Line-like is the default.
For examples see :ref:`spines_examples`.
cóy)Nr©©Úselfs úT/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/spines.pyÚ__str__z
Spine.__str__ sØóc ót|d i|¤Ž||_|j|jj d¬««||_|j
d«|jtjd«|jtjd«|jd«d|_ |jd«|j|jj«d|_d|_t%j&t(j*|¬ «||_d
|_t1j2«|_y) 
Parameters
----------
axes : `~matplotlib.axes.Axes`
The `~.axes.Axes` instance containing the spine.
spine_type : str
The spine type.
path : `~matplotlib.path.Path`
The `.Path` instance used to draw the spine.
Other Parameters
----------------
**kwargs
Valid keyword arguments are:
%(Patch:kwdoc)s
ÚrootÚnonezaxes.edgecolorzaxes.linewidthÚ
projectingNg@)ÚpathÚliner
)ÚsuperÚ__init__ÚaxesÚ
set_figureÚ
get_figureÚ
spine_typeÚ
set_facecolorÚ
set_edgecolorÚmplÚrcParamsÚ
set_linewidthÚ set_capstyleÚaxisÚ
set_zorderÚ
set_transformÚ transDataÚ_boundsÚ _positionrÚcheck_isinstanceÚmpathÚPathÚ_pathÚ _patch_typeÚ mtransformsÚIdentityTransformÚ_patch_transform)r rrrÚkwargsÚ __class__s €r
rzSpine.__init__#sø€ô& ÑÑ"˜ˆŒ Ø ˜Ÿ ™ ×,°%ÐŒØ ×ј6Ô ×Ñœ3Ÿ<™<Ð(8Ñ ×Ñœ3Ÿ<™<Ð(8Ñ ×јˆŒ à ˜ÔØ ×ј4Ÿ9™9׈Œ ð
ˆŒÜ ×ÑœeŸj™j¨tÕˆŒ
ð"ˆÔô!,× =Ñ =Ó ?ˆÕrcód|_||_|dz|_|dz|_||_||_t jj||«|_ |j|jj«d|_
y)zSet the spine to be arc-like.ÚarcéTN)r-Ú_centerÚ_widthÚ_heightÚ_theta1Ú_theta2r*r+r4r,r%rÚ transAxesÚstale)r ÚcenterÚradiusÚtheta1Útheta2s r
Ú
set_patch_arczSpine.set_patch_arcXsjà ˆÔØˆŒ ؘq‘jˆŒ Ø ‘zˆŒ ؈Œ ؈Œ Ü—Z‘Z—^‘^ F¨FÓŒ
à ×ј4Ÿ9™9׈
rcó d|_||_|dz|_|dz|_|j |j
j «d|_y)zSet the spine to be circular.Úcircler5TN)r-r6r7r8r%rr;r<)r r=r>s r
Úset_patch_circlezSpine.set_patch_circleesFà#ˆÔ؈Œ ؘq‘jˆŒ Ø ‘zˆŒ à ×ј4Ÿ9™9׈
rcó d|_d|_y)zSet the spine to be linear.rTN)r-r<r s r
Úset_patch_linezSpine.set_patch_lineosà!ˆÔ؈
rcó€|jdvsJ|j|jd«|j|jd«f}|j|j«}|j|j
«}t
j«j|dz|dz«j|Ž|_
y)a!
Notes
-----
This cannot be called until after this has been added to an Axes,
otherwise unit conversion will fail. This makes it very important to
call the accessor method and not directly access the transformation
member variable.
©r4rCréçà?N) r-Úconvert_xunitsr6Úconvert_yunitsr7r8r.ÚAffine2DÚscaleÚ translater0)r r=ÚwidthÚheights r
Ú_recompute_transformzSpine._recompute_transformuð×ÑÐ#4Ñ×% d§l¡l°1¡oÓ×% d§l¡l°1¡oÓ8ˆà×# D§K¡KÓØ×$ T§\¡\Óð!¤ × 4Ñ 4Ó 6ß
‰U5˜3; ¨¡ Ó
‰Y˜ð! ˆÕrcót|jdvr|j«|jSt|«S)NrH)r-rRr0rÚget_patch_transform)r r2s €r
rTzSpine.get_patch_transform‡s8ø€Ø × Ñ Ð × ×  0rcó|j«t| |¬«}|j|jj «s|S|g}|jj «}t
th|£h|jj£z«d«}t
th|£h|jj£z«d«}||fD]}|Œ|j«}|j} |j}
|
dk(rd} d} n|
dk(rd} d} nd} d} |jd¬ «j}
| | zd
z |
z} | | zd
z |
z} |jj «ro|j d k(r)|j"| z
|_|j$| z|_n7|j d k(r(|j&| z
|_|j(| z|_|j*j «ro|j d
k(r)|j$| z|_|j"| z
|_n7|j dk(r(|j(| z|_|j&| z
|_|j-|«Œžt.j0j3|«S)a
Return the window extent of the spines in display space, including
padding for ticks (but not their labels)
See Also
--------
matplotlib.axes.Axes.get_tightbbox
matplotlib.axes.Axes.get_window_extent
)ÚrendererNÚoutrIrÚinrJTréHÚleftÚbottomÚrightÚtop)Ú_adjust_locationrÚget_window_extentr#Ú get_visibleÚ
_update_ticksÚnextÚiterÚ
majorTicksÚ
minorTicksÚfrozenÚ_sizeÚ_tickdirrÚdpiÚ tick1linerÚx0Úx1Úy0Úy1Ú tick2lineÚappendr.ÚBboxÚunion)r rVÚbbÚbboxesÚ drawn_ticksÚ
major_tickÚ
minor_tickÚtickÚbb0ÚticklÚtickdirÚpadoutÚpadinrir2s €r
r_zSpine.get_window_extentŽs?ø€ð
×ÑÔÜ
‰WÑ
Ð
Ø 9‰9Ð  D§I¡I×$9Ñ$9Ô$;؈I؈ؗi‘i× äœ$˜~ ˜~Ð0G°$·)±)×2FÑ2FÐ0GÑHÈ$ÓOˆ
Üœ$˜~ ˜~Ð0G°$·)±)×2FÑ2FÐ0GÑHÈ$ÓOˆ
Ø Ð" ˆD؈|ØØ—)‘)“+ˆCØ—J‘JˆEØ—m‘mˆGؘ%ÒØØØ˜D’ØØàØØ—/‘/ t0ˆCؘe‘^ bÑ(¨3Ñ.ˆ˜EM Ñ,ˆ~‰~×—??  ŸV™V f™_C”FØ ŸV™V e™^C•FØ—_‘_¨Ò ŸV™V f™_C”FØ ŸV™V e™^C”Fà~‰~×—??  ŸV™V f™_C”FØ ŸV™V e™^C•FØ—_‘_¨Ò ŸV™V f™_C”FØ ŸV™V f™_C”FØ M‰M˜ ðE" ôH×Ñ×% -rcó|jS©N)r,r s r
Úget_pathzSpine.get_pathÈó Øz‰zÐrcób|j€#d|_|j|j«yy)N)Úoutwardç)r(Ú set_positionr s r
Ú_ensure_position_is_setzSpine._ensure_position_is_setËs*Ø >‰>Ð -ˆDŒNØ × Ñ ˜dŸn™nÕ  "rcó ||_d|_y)
Register an axis.
An axis should be registered with its corresponding spine from
the Axes instance. This allows the spine to clear any axis
properties when needed.
TN)r#r<)r r#s r
Ú
register_axiszSpine.register_axisÑsðˆŒ Øˆ
rcór|j«|j|jj«yy)zClear the current spine.N)Ú_clearr#Úclearr s r
rz Spine.clearÜs(à Œ
Ø 9‰9Ð Ø I‰IO‰OÕ ð !rcód|_y)
Clear things directly related to the spine.
In this way it is possible to avoid clearing the Axis as well when calling
from library code where it is known that the Axis is cleared separately.
N)r(r s r
z Spine._clearâs ðˆrcóÐ|jdk(ry|j|j\}}n||jdvr$|jjj\}}nJ|jdvr$|jjj
\}}nt
d|j«|jdk(r„|jdvr\ |jj«} |jj«}||z|z}||z|z}||kDr||}}tjjtj|«tj|««|_|jd
k(rË|j"t%j&«}n|j"j)«}|j+|jjj«\}} |jj-«}|j+|«}||z
||z
z } | |_| |_yt
d |jz«y|j j2}
|
j4d k(sJd
«|jdvr ||
d<||
d<y|jdvr ||
d<||
d<yt
d |jz«#t$rd}YŒÞwxYw#t$rd }YŒÕwxYw#t$r|}YŒÚwxYw)z4Automatically set spine bounds to the view interval.rCrZr\©r]r[úunknown spine spine_type: r4©r[r]rIrr[z#unable to set bounds for spine "%s")r5r5zunexpected vertices shape©rrI)rIrI)rr©rIr)rr'rÚviewLimÚ intervalyÚ intervalxÚ
ValueErrorr-Úget_theta_directionÚAttributeErrorÚget_theta_offsetr*r+r4ÚnpÚrad2degr,r#r.r/Ú
get_transformÚ transformÚ get_roriginr8r7ÚverticesÚshape) r ÚlowÚhighÚ directionÚoffsetÚtrÚrminÚrmaxÚroriginÚscaled_diameterÚv1s r
r^zSpine._adjust_locationëð ?‰?˜ à <‰<Ð Ÿ ‰IˆC‘Ø
_‰_Ð 1Ñ
Ÿ ™ ×3‰IˆC‘Ø
_‰_Ð 1Ñ
Ÿ ™ ×3‰IˆC‘äÐ9¸$¿/¹/Ð9JÐ × Ñ ˜ Ð"3Ò"Ø $§ ¡ × =Ñ =Ó ?Ø!ŸY™Y×9˜IÑ.ؘ'¨&Ñ0ؘ:Ø $ c˜"ŸZ™ZŸ^™^¬B¯J©J°s«O¼R¿Z¹ZÈÓ=MÓN
à—?‘? hÒ—y(×<™à!ŸY™Yר!#§¡¨d¯i©i×.?Ñ.?×.IÑ.IÓ!JJD˜8Ø"&§)¡)×"7Ñ"7Ó"9˜ð#%§,¡,¨wÓ"7˜Ø'+¨g¡~¸¹.Ñ&IOØ#2D”LØ"1D•Kô!Ð!FØ!%§¡ñ"1ó2ð#/ð(×$ˆBØ—88˜ BÐ'BÓ Ð"3Ñ4‘Ø4’ØÐ$5Ñ4‘Ø4’ä Ð!FØ!%§¡ñ"1ó2øôU"Ø !“Ið"ûôØ“Fðûô"'Ø"&šð'ús6à J3Ã$KÇKÊ3 KËKË KËKË K%Ë$K%cóT|j«t| |«}d|_|S)NF)r^rÚdrawr<)r rVÚretr2s €r
r­z
Spine.draw+s)ø€à ×ÑÔ܉g‰l˜8ÓØˆŒ
؈
rcó
|dvrn+t|«dk7r td«|ddvr td«||_|j|j ««|j
|j
j
«d|_y) a±
Set the position of the spine.
Spine position is specified by a 2 tuple of (position type,
amount). The position types are:
* 'outward': place the spine out from the data area by the specified
number of points. (Negative values place the spine inwards.)
* 'axes': place the spine at the specified Axes coordinate (0 to 1).
* 'data': place the spine at the specified data coordinate.
Additionally, shorthand notations define a special positions:
* 'center' -> ``('axes', 0.5)``
* 'zero' -> ``('data', 0.0)``
Examples
--------
:doc:`/gallery/spines/spine_placement_demo`
)r=Úzeror5z&position should be 'center' or 2-tupler)rÚdataz:position[0] should be one of 'outward', 'axes', or 'data' NT)Úlenr—r(r%Úget_spine_transformr#Ú reset_ticksr<)r Úpositions r
r…zSpine.set_position2s†ð* Ð ä8‹} Ò Ð!IÓ˜‰{Ð"=Ñ ð"6óŒØ ×ј4× 9‰9Ð Ø I‰I× ˆ
rcó:|j«|jS)zReturn the spine position.)r†r(r s r
Ú get_positionzSpine.get_positionUsà ×~‰~Ðrcóp|j«|j}t|t«r|dk(rd}n|dk(rd}t |«dk(sJd«|\}}t j gd¢|¬«|jd vr|jjd
¬ «}nC|jd vr|jjd
¬ «}ntd
|j«|dk(rj|dk(r|Sdddddœ|j}|tj|«zdz }|tjg|¢|j!d¬«j"­ŽzS|dk(rk|jd vr'tj$j'dddd|d«|zS|jdvr'tj$j'ddddd|«|zSy|dk(rö|jdvr|dz}|jd vrctj(tj$«j+|d«|jj,z|jj,«S|jdvrctj(|jj,tj$«j+d|«|jj,z«Syy)zReturn the spine transform.r=)rrJ)rr5zposition should be 2-tuple)r)Ú
position_typerŽÚgrid)Úwhichrrr)éÿÿÿÿrr“)rr)rZr\r[r]rYFrrrIr)r\r]N)r†r(Ú
isinstanceÚstrr²rÚ
check_in_listrrÚget_yaxis_transformÚget_xaxis_transformr—rÚarrayr.ÚScaledTranslationrÚdpi_scale_transrMÚ from_valuesÚblended_transform_factoryrOr&)r ÚamountÚbase_transformÚ
offset_vecÚ offset_dotss r
zSpine.get_spine_transformZà ×—>>ˆÜ Ô ˜8Ò(‘ؘVÒ&Ü8} Ò?Ð#?Ó!Ø (ш
 ×ÑÒ6Ø)6õ ?‰?Ð !ŸY™Y×ÐH‰NØ
_‰_Ð 1Ñ
!ŸY™Y×ÐH‰NäÐ9¸$¿/¹/Ð9LÐ ˜IÒ ˜Š{Ø%à&-¸Ø(/¸ñ à $§¡ñ1
ð%¤r§x¡x°
Ó';Ñ;¸@ Ø%×WØWØ*.¯/©/¸u¨/Ó*E×*UÑ*UòWñWðXð˜fÒ
Ð"3Ñ#×,׸A¸qÀ!ÀVÈQÓÐ$5ѸA¸qÀ!ÀQÈÓ˜fÒ
Ð"2ј! ØÐ"3Ñ"××*×4°V¸QÓ—i‘i×—II×Ð$5Ñ"×—II××*×4°Q¸Ó—i‘i×%rcóÎ|jdk(r td«|tj|«r|\}}|j «xsd\}}||}||}||f|_d|_y)
Set the spine bounds.
Parameters
----------
low : float or None, optional
The lower spine bound. Passing *None* leaves the limit unchanged.
The bounds may also be passed as the tuple (*low*, *high*) as the
first positional argument.
.. ACCEPTS: (low: float, high: float)
high : float or None, optional
The higher spine bound. Passing *None* leaves the limit unchanged.
rCz5set_bounds() method incompatible with circular spinesN©NNT)rr—rÚiterableÚ
get_boundsr'r<)r Úold_lowÚold_highs r
Ú
set_boundszSpine.set_bounds•swð" ?‰?˜ ØIð
Ià ˆ<œBŸK™K¨Ô‰IˆCØ ŸO™OÓÑˆØ ˆ;؈CØ ˆ<؈DؘTŒ ؈
rcó|jS)zGet the bounds of the spine.)r'r s r