ó
    {ñ:iáh ã                   óž  • S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSK	r
SSK	JrJrJrJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK J!r"  SSK#J$r%  SSK&J'r'  SSK(J)r)J*r*  SSK#J+r+  SSK,J-r-  S	S
K.J/r/  S	SK.J0r0  S	SK.J1r1  \Rd                  \Rf                  " S/S/S/S.5       " S S\'5      5       5       r4SS jr5 " S S5      r6g)aR  
axes3d.py, original mplot3d version by John Porter
Created: 23 Sep 2005

Parts fixed by Reinier Heeres <reinier@heeres.eu>
Minor additions by Ben Axelrod <baxelrod@coroware.com>
Significant updates and revisions by Ben Root <ben.v.root@gmail.com>

Module containing Axes3D, an object which can plot 3D objects on a
2D matplotlib figure.
é    )ÚdefaultdictN)Ú_apiÚcbookÚ
_docstringÚ_preprocess_data)ÚAxes)Ú_axis_method_wrapperÚ_process_plot_format)ÚBbox)ÚTriangulationé   )Úart3d)Úproj3d)Úaxis3dÚxlim3dÚylim3dÚzlim3d)ÚxlimÚylimÚzlimc                   óœ  ^ • \ rS rSrSrSrSr\R                  " 5       \	R                  S'   \R                  " 5       \	R                  S'    S¦SS	S
SSSSSSS.	U 4S jjjrS rS rS rS rS rS r\" SS5      r\" SS5      rS rS§U 4S jjrS rSS.S jrS¦S jr\R6                  U 4S  j5       rS! rS" r\" SS#5      r\" SS$5      r S% r!S& r"SSSSS'.S( jr#S¨S) jr$S©S* jr%  SªS+ jr&S, r' S«S- jr(S«S. jr)S«S/ jr*S«S0 jr+S©SSSSSS1.S2 jjr,S©SSSSSS3.S4 jjr-S©SSSSSS5.S6 jjr.S©SSSSSS7.S8 jjr/\-r0\.r1\/r2S9 r3S: r4S; r5\" SS<5      r6\" S=S>5      r7\" S?S>5      r8\" SS>5      r9\:" S@Rv                  / SQ5      u  \7l        \8l        \9l        \" SSA5      r<\" SSB5      r=\" SSC5      r>\" SSD5      r?\" SSE5      r@\" SSFSGSH0SI9rA\" SSJ5      rB\BR                  (       a%  \B=R                  \CRˆ                  " SK5      -  sl        SL rE  S¬SM jrFS¦SN jrG S­SOSPSQ\HSR\IR”                  4SS jjrKST rLS®SU jrMSV rNSW rOSX rPSY rQSZ rRU 4S[ jrSS\ rTS] rUS^ rVS_ rWS` rXS¦Sa jrYSb rZSc r[Sd r\S¦Se jr]Sf\^Sg\^SR\IR”                  4Sh jr_Si r`Sj raSk rb  S¯Sl jrcSm rdSn reSo rfS©Sp jrgSq rhSriSrjS°Sr jrkS±U 4Ss jjrlSt rm\" SSu5      rnSv roS¦SSw.U 4Sx jjjrp\prq\	Rà                  rrSSSy.U 4Sz jjrs\srtSS{SSSS|.S} jruSSSSSS~.S jrvSSw.S€ jrwSSSSSSS�.S‚ jrxS²S„ jry  S³S… jrzS´SSw.S† jjr{SµS‡ jr|\}" 5       SSƒSSSSˆ.U 4S‰ jj5       r~\~r\}" 5       SSƒSSSSˆ.U 4SŠ jj5       r€S‹ r�\}" 5       SSSSŒ.U 4S� jj5       r‚\‚rƒ\}" 5       SSSSŒ.U 4SŽ jj5       r„S¶SSw.U 4S� jjjr…\}" / S�QS‘9 S·SSw.U 4S’ jjj5       r†\†r‡\}" 5       S¸SSw.U 4S“ jjj5       rˆ\}" 5         S¹SSw.S” jj5       r‰SºU 4S• jjrŠ\}" 5       SS–S—SSS˜.S™ j5       r‹\‹rŒSSSSSSš.S› jr�\}" / SœQS‘9     S»S� j5       rŽS¦SSSSž.U 4SŸ jjjr�\}" 5       S S¡S¢S
SSSS£.S¤ j5       r�\�r‘S¥r’U =r“$ )¼ÚAxes3Dé)   zé
3D Axes object.

.. note::

    As a user, you do not instantiate Axes directly, but use Axes creation
    methods instead; e.g. from `.pyplot` or `.Figure`:
    `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.
Ú3d©ÚxÚyÚzr   ÚviewNé   iÄÿÿÿr   ÚperspT)	ÚelevÚazimÚrollÚ	shareviewÚsharezÚ	proj_typeÚfocal_lengthÚ
box_aspectÚcomputed_zorderc       	         óÄ  >• Uc  / SQnX@l         X0l        XPl        U R                  X‰5        X°l        [
        R                  " 5       U l        [
        R                  " 5       U l        Sn[        Xî/SU-
  SU-
  //5      U l	        [
        R                  " 5       U l
        U R                  U R                  U R                   U R                  5        Xpl        Ub%  U R                  S   R                  X5        SU l        X`l        Ub  U R                  S   R                  X5        UR#                  SS	5      (       a  [%        S
5      e[&        TU ]P  " X/UQ7SU
S.UD6  [&        TU ]U  5         U R-                  5         SU l        SU l        SU l        U R5                  5         SU l        U R9                  5         U R;                  SS9nUR<                  R>                  RA                  SU RB                  5        UR<                  R>                  RA                  SU RD                  5        UR<                  R>                  RA                  SU RF                  5        U RI                  5         U RJ                  RM                  S5        U RN                  RQ                  5       RS                  SS/5      nUS   US   -
  u  U l*        U l+        U RX                  SS R[                  S	5        g)ag	  
Parameters
----------
fig : Figure
    The parent figure.
rect : tuple (left, bottom, width, height), default: None.
    The ``(left, bottom, width, height)`` Axes position.
elev : float, default: 30
    The elevation angle in degrees rotates the camera above and below
    the x-y plane, with a positive angle corresponding to a location
    above the plane.
azim : float, default: -60
    The azimuthal angle in degrees rotates the camera about the z axis,
    with a positive angle corresponding to a right-handed rotation. In
    other words, a positive azimuth rotates the camera about the origin
    from its location along the +x axis towards the +y axis.
roll : float, default: 0
    The roll angle in degrees rotates the camera about the viewing
    axis. A positive angle spins the camera clockwise, causing the
    scene to rotate counter-clockwise.
shareview : Axes3D, optional
    Other Axes to share view angles with.  Note that it is not possible
    to unshare axes.
sharez : Axes3D, optional
    Other Axes to share z-limits with.  Note that it is not possible to
    unshare axes.
proj_type : {'persp', 'ortho'}
    The projection type, default 'persp'.
focal_length : float, default: None
    For a projection type of 'persp', the focal length of the virtual
    camera. Must be > 0. If None, defaults to 1.
    For a projection type of 'ortho', must be set to either None
    or infinity (numpy.inf). If None, defaults to infinity.
    The focal length can be computed from a desired Field Of View via
    the equation: focal_length = 1/tan(FOV/2)
box_aspect : 3-tuple of floats, default: None
    Changes the physical dimensions of the Axes3D, such that the ratio
    of the axis lengths in display units is x:y:z.
    If None, defaults to 4:4:3
computed_zorder : bool, default: True
    If True, the draw order is computed based on the average position
    of the `.Artist`\s along the view direction.
    Set to False if you want to manually control the order in which
    Artists are drawn on top of each other using their *zorder*
    attribute. This can be used for fine-tuning if the automatic order
    does not produce the desired result. Note however, that a manual
    zorder will only be correct for a limited view angle. If the figure
    is rotated by the user, it will look wrong from certain angles.

**kwargs
    Other optional keyword arguments:

    %(Axes3D:kwdoc)s
N)ç        r,   ç      ð?r-   çF]tÑE§?r   r   Údatalimr   Úauto_add_to_figureFzSauto_add_to_figure is no longer supported for Axes3D. Use fig.add_axes(ax) instead.T)Úframeonr)   çUUUUUU•?©ÚrootÚmotion_notify_eventÚbutton_press_eventÚbutton_release_eventr   ©r   r   )r   r   ).Úinitial_azimÚinitial_elevÚinitial_rollÚset_proj_typer*   r   ÚunitÚ
xy_viewLimÚ
zz_viewLimÚ
xy_dataLimÚ
zz_dataLimÚ	view_initÚ_sharezÚ_shared_axesÚjoinÚ_adjustableÚ
_shareviewÚpopÚAttributeErrorÚsuperÚ__init__Úset_axis_offÚset_axis_onÚMÚinvMÚ_view_marginÚautoscale_viewÚ	fmt_zdataÚ
mouse_initÚ
get_figureÚcanvasÚ	callbacksÚ_connect_picklableÚ_on_moveÚ_button_pressÚ_button_releaseÚset_top_viewÚpatchÚset_linewidthÚtransLimitsÚinvertedÚ	transformÚ	_pseudo_wÚ	_pseudo_hÚspinesÚset_visible)ÚselfÚfigÚrectr"   r#   r$   r%   r&   r'   r(   r)   r*   ÚargsÚkwargsÚxymarginÚpseudo_bboxÚ	__class__s                   €Ú^/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/mpl_toolkits/mplot3d/axes3d.pyrK   ÚAxes3D.__init__<   sˆ  ø€ ð~ ‰<Ú'ˆDà ÔØ ÔØ ÔØ×Ñ˜9Ô3Ø.ÔäŸ)š)›+ˆŒÜŸ)š)›+ˆŒØˆÜ Ð 4Ø!" X¡¨q°8©|Ð <ð >ó ?ˆŒô Ÿ)š)›+ˆŒð 	�‰�t×(Ñ(¨$×*;Ñ*;¸T×=NÑ=NÔOàŒØÑØ×Ñ˜cÑ"×'Ñ'¨Ô5Ø(ˆDÔà#ŒØÑ Ø×Ñ˜fÑ%×*Ñ*¨4Ô;à�:‰:Ð*¨E×2Ñ2Ü ð0óð ô
 	‰ÒØð	
Ø=Añ	
Ø#°
ñ	
ØEKò	
ô 	‰ÑÔà×ÑÔØˆŒØˆŒ	à ˆÔØ×ÑÔð ˆŒà�‰ÔØ�o‰o 4ˆoÐ(ˆØ�
‰
×Ñ×/Ñ/Ø! 4§=¡=ô	2à�
‰
×Ñ×/Ñ/Ø  $×"4Ñ"4ô	6à�
‰
×Ñ×/Ñ/Ø" D×$8Ñ$8ô	:à×ÑÔà�
‰
× Ñ  Ô#à×&Ñ&×/Ñ/Ó1×;Ñ;¸VÀVÐ<LÓMˆØ)4°Q©¸+Àa¹.Ñ)HÑ&ˆŒ˜œð 	�‰‘Aˆ×"Ñ" 5Õ)ó    c                 ó    • SU l         SU l        g )NFT©Ú	_axis3donÚstale©re   s    rm   rL   ÚAxes3D.set_axis_offÂ   s   € ØˆŒØˆ�
ro   c                 ó    • SU l         SU l        g ©NTrq   rt   s    rm   rM   ÚAxes3D.set_axis_onÆ   s   € ØˆŒØˆ�
ro   c                 ó8   • U R                   R                  U5      $ )z[
For artists in an Axes, if the zaxis has units support,
convert *z* using zaxis unit type
)ÚzaxisÚconvert_units)re   r   s     rm   Úconvert_zunitsÚAxes3D.convert_zunitsÊ   s   € ð
 �z‰z×'Ñ'¨Ó*Ð*ro   c                 óÚ   • SU R                   -  nSU R                   -  nSU R                   -  nSU R                   -  nU* U4U R                  l        U* U4U R                  l        SU l        g )Ngffffffî?gÍÌÌÌÌÌì?T)Ú_distÚviewLimÚ	intervalxÚ	intervalyrs   )re   ÚxdwlÚxdwÚydwlÚydws        rm   r[   ÚAxes3D.set_top_viewÑ   sg   € ð �d—j‘jÑ ˆØ�D—J‘JÑˆØ�d—j‘jÑ ˆØ�D—J‘JÑˆà#' %¨ ˆ�‰ÔØ#' %¨ ˆ�‰ÔØˆ�
ro   c                 ó¦   • [         R                  " U 5      U l        [         R                  " U 5      U l        [         R
                  " U 5      U l        g)z5Init 3D Axes; overrides creation of regular X/Y Axes.N)r   ÚXAxisÚxaxisÚYAxisÚyaxisÚZAxisrz   rt   s    rm   Ú
_init_axisÚAxes3D._init_axisÝ   s2   € ä—\’\ $Ó'ˆŒ
Ü—\’\ $Ó'ˆŒ
Ü—\’\ $Ó'ˆ�
ro   c                 ó   • U R                   $ )z0Return the ``ZAxis`` (`~.axis3d.Axis`) instance.)rz   rt   s    rm   Ú	get_zaxisÚAxes3D.get_zaxisã   s   € à�z‰zÐro   rz   Úget_gridlinesÚget_ticklinesc           
      ó‚   • Uu  p#pEpgX$U4X4U4X5U4X%U4X$U4X4U4X5U4X%U4/n[         R                  " X€R                  5      $ )z:Return cube with limits from *vals* transformed by self.M.)r   Ú_proj_pointsrN   )	re   ÚvalsÚminxÚmaxxÚminyÚmaxyÚminzÚmaxzÚxyzss	            rm   Ú_transformed_cubeÚAxes3D._transformed_cubeê   sl   € à-1Ñ*ˆ�D Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"Ø˜TÐ"ð$ˆô ×"Ò" 4¯©Ó0Ð0ro   Fc                 óF  >• [         R                  " SUS9  [        TU ]  SX#US9  Xl        US;   Gaï  U R                  U5      n[        R                  " U R                  R                  5       U R                  R                  5       U R                  R                  5       /5      n[        R                  " USS9nU R                  S:X  aš  [        R                  " USS9n[        Xu   U R                   U   -  5      n	X�R                   -  n
[#        U R$                  U R&                  U R(                  45       H)  u  p¼Xµ;   d  M  U" X‹   X«   S	-  -
  X‹   X«   S	-  -   S
SS9  M+     g[        R                  " U R                   5      nXu   XÕ'   1 SkR+                  U5      nU(       al  UR-                  5       n[        R.                  R1                  U R                   U   5      n[        R.                  R1                  XÕ   5      nXß==   UU-  -  ss'   U R3                  U5        gg)aA  
Set the aspect ratios.

Parameters
----------
aspect : {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'}
    Possible values:

    =========   ==================================================
    value       description
    =========   ==================================================
    'auto'      automatic; fill the position rectangle with data.
    'equal'     adapt all the axes to have equal aspect ratios.
    'equalxy'   adapt the x and y axes to have equal aspect ratios.
    'equalxz'   adapt the x and z axes to have equal aspect ratios.
    'equalyz'   adapt the y and z axes to have equal aspect ratios.
    =========   ==================================================

adjustable : None or {'box', 'datalim'}, optional
    If not *None*, this defines which parameter will be adjusted to
    meet the required aspect. See `.set_adjustable` for further
    details.

anchor : None or str or 2-tuple of float, optional
    If not *None*, this defines where the Axes will be drawn if there
    is extra space due to aspect constraints. The most common way to
    specify the anchor are abbreviations of cardinal directions:

    =====   =====================
    value   description
    =====   =====================
    'C'     centered
    'SW'    lower left corner
    'S'     middle of bottom edge
    'SE'    lower right corner
    etc.
    =====   =====================

    See `~.Axes.set_anchor` for further details.

share : bool, default: False
    If ``True``, apply the settings to all shared Axes.

See Also
--------
mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect
)ÚautoÚequalÚequalxyÚequalyzÚequalxz©Úaspectr¢   )r¨   Ú
adjustableÚanchorÚshare©r£   r¤   r¦   r¥   r   ©Úaxisr/   ç       @TN©r¢   Úview_margin>   r   r   é   )r   Úcheck_in_listrJ   Ú
set_aspectÚ_aspectÚ_equal_aspect_axis_indicesÚnpÚarrayrŠ   Úget_view_intervalrŒ   rz   ÚptprF   ÚmeanÚmaxÚ_box_aspectÚ	enumerateÚ
set_xlim3dÚ
set_ylim3dÚ
set_zlim3dÚ
differencerH   ÚlinalgÚnormÚset_box_aspect)re   r¨   r©   rª   r«   Ú
ax_indicesÚview_intervalsrº   r»   ÚscaleÚdeltasÚiÚset_limr)   Úremaining_ax_indicesÚ	remainingÚold_diagÚnew_diagrl   s                     €rm   r´   ÚAxes3D.set_aspect÷   sç  ø€ ô` 	×ÒÐMØ"(ò	*ä‰ÑØ jÀuð 	ñ 	NàŒàÐ?Ô?Ø×8Ñ8¸Ó@ˆJäŸXšX t§z¡z×'CÑ'CÓ'EØ'+§z¡z×'CÑ'CÓ'EØ'+§z¡z×'CÑ'CÓ'Eð'Gó HˆNô —&’&˜¨aÑ0ˆCØ×Ñ 9Ó,Ü—w’w˜~°AÑ6�Ü˜C™O¨d×.>Ñ.>¸zÑ.JÑJÓK�Ø×!1Ñ!1Ñ1�ä"+¨T¯_©_Ø-1¯_©_Ø-1¯_©_ð->ö #?‘J�Að •Ù ¡¨&©)°B©,Ñ 6¸¹À&Á)ÈBÁ,Ñ8NØ%)°tô=ò	#?ô  ŸXšX d×&6Ñ&6Ó7�
Ø),©�
Ñ&Ú'0×';Ñ';¸JÓ'GÐ$Þ'Ø 4× 8Ñ 8Ó :�IÜ!Ÿy™yŸ~™~¨d×.>Ñ.>¸zÑ.JÓK�HÜ!Ÿy™yŸ~™~¨jÑ.DÓE�HØÓ)¨X¸Ñ-@Ñ@Ó)Ø×#Ñ# JÕ/ð= @ro   c                 óf   • / nUS:X  a  / SQnU$ US:X  a  SS/nU$ US:X  a  SS/nU$ US:X  a  SS/nU$ )	zæ
Get the indices for which of the x, y, z axes are constrained to have
equal aspect ratios.

Parameters
----------
aspect : {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'}
    See descriptions in docstring for `.set_aspect()`.
r£   ©r   r   r²   r¤   r   r   r¦   r²   r¥   © )re   r¨   rÆ   s      rm   r¶   Ú!Axes3D._equal_aspect_axis_indicesM  sm   € ð ˆ
Ø�WÓÚ"ˆJð Ðð �yÓ Ø˜Q˜ˆJð
 Ðð	 �yÓ Ø˜Q˜ˆJð Ðð �yÓ Ø˜Q˜ˆJØÐro   r   )Úzoomc                óL  • US::  a  [        SU S35      eUc  [        R                  " S[        S9nO.[        R                  " U[        S9n[        R
                  " SUS9  US	U-  [        R                  R                  U5      -  -  nU R                  US
S9U l	        S
U l
        g)aó  
Set the Axes box aspect.

The box aspect is the ratio of height to width in display
units for each face of the box when viewed perpendicular to
that face.  This is not to be confused with the data aspect (see
`~.Axes3D.set_aspect`). The default ratios are 4:4:3 (x:y:z).

To simulate having equal aspect in data space, set the box
aspect to match your data range in each dimension.

*zoom* controls the overall size of the Axes3D in the figure.

Parameters
----------
aspect : 3-tuple of floats or None
    Changes the physical dimensions of the Axes3D, such that the ratio
    of the axis lengths in display units is x:y:z.
    If None, defaults to (4, 4, 3).

zoom : float, default: 1
    Control overall size of the Axes3D in the figure. Must be > 0.
r   zArgument zoom = z must be > 0N)é   r×   é   ©Údtype)rØ   r§   g¡·Ÿ¶}þ?T©Úreverse)Ú
ValueErrorr·   ÚasarrayÚfloatr   Úcheck_shaperÃ   rÄ   Ú_roll_to_verticalr½   rs   )re   r¨   rÕ   s      rm   rÅ   ÚAxes3D.set_box_aspectb  s˜   € ð0 �1‹9ÜÐ/°¨v°\ÐBÓCÐCà‰>Ü—Z’Z 	´Ñ7‰Fä—Z’Z ¬eÑ4ˆFÜ×Ò˜T¨&Ò1ð
 	Ð,¨tÑ3´b·i±i·n±nÀVÓ6LÑLÑLˆà×1Ñ1°&À$Ð1ÐGˆÔØˆ�
ro   c                 ó�  • Uc  U R                  SS9nU R                  5       R                  n[        R                  R                  5       R                  U5      nUR                  UR                  -  nSnUR                  5       nUR                  XVU5      nU R                  UR                  U R                  5       U5      S5        g )NT)Úoriginalr   Úactive)Úget_positionrT   ÚtransSubfigureÚmtransformsr   r=   ÚtransformedÚheightÚwidthÚfrozenÚshrunk_to_aspectÚ_set_positionÚanchoredÚ
get_anchor)re   ÚpositionÚtransÚbbÚ
fig_aspectr)   ÚpbÚpb1s           rm   Úapply_aspectÚAxes3D.apply_aspect‹  s¥   € ØÑØ×(Ñ(°$Ð(Ð7ˆHð
 —‘Ó!×0Ñ0ˆÜ×Ñ×"Ñ"Ó$×0Ñ0°Ó7ˆà—Y‘Y §¡Ñ)ˆ
àˆ
Ø�_‰_ÓˆØ×!Ñ! *°*Ó=ˆØ×Ñ˜3Ÿ<™<¨¯©Ó(9¸2Ó>ÀÕIro   c                 óš  >• U R                  5       (       d  g U R                  5         U R                  R                  U5        SU l        U R                  5       nU R                  U(       a  U" X5      OS 5        U R                  5       U l        [        R                  R                  U R                  5      U l        S U R                   5       nU R                  (       aœ  [        S U R                   R#                  5        5       5      S-   nU=pV[%        US SS9 H[  n['        U[(        R*                  5      (       a  XWl        US-  nM/  ['        U[.        R0                  5      (       d  MP  Xgl        US-  nM]     OU H  nUR3                  5         M     U R4                  (       a–  U R                   R#                  5        H  nUR7                  U5        M     U R                   R#                  5        H  nUR9                  U5        M     U R                   R#                  5        H  nUR                  U5        M     [:        T	U ]  U5        g )NFc              3   ó¶   #   • U  HO  n[        U[        R                  [        R                  45      (       d  M4  UR                  5       (       d  MK  Uv •  MQ     g 7f©N)Ú
isinstanceÚmcollÚ
CollectionÚmpatchesÚPatchÚget_visible)Ú.0Úartists     rm   Ú	<genexpr>ÚAxes3D.draw.<locals>.<genexpr>²  sB   é € ð #&Ú!/�vÜ˜&¤5×#3Ñ#3´X·^±^Ð"D×Eó à×"Ñ"×$÷ ‰F¢ùs   ‚3A¹AÁ	Ac              3   óB   #   • U  H  nUR                  5       v •  M     g 7frû   )Ú
get_zorder)r  r®   s     rm   r  r  ¹  s"   é € ð  EÚ,C Dð !%§¡× 1Ð 1Ú,Cùs   ‚r   c                 ó"   • U R                  5       $ rû   )Údo_3d_projection)r  s    rm   Ú<lambda>ÚAxes3D.draw.<locals>.<lambda>¾  s   € °F×4KÑ4KÔ4Mro   T)ÚkeyrÜ   )r  Ú_unstale_viewLimr\   ÚdrawÚ_frameonÚget_axes_locatorr÷   Úget_projrN   r·   rÃ   ÚinvrO   Ú	_childrenr*   r¼   Ú	_axis_mapÚvaluesÚsortedrü   rý   rþ   Úzorderrÿ   r   r	  rr   Ú	draw_paneÚ	draw_gridrJ   )
re   ÚrendererÚlocatorÚcollections_and_patchesÚzorder_offsetÚcollection_zorderÚpatch_zorderr  r®   rl   s
            €rm   r  ÚAxes3D.drawœ  sÛ  ø€ à×Ñ×!Ñ!ØØ×ÑÔð 	�
‰
�‰˜Ô!ØˆŒð ×'Ñ'Ó)ˆØ×Ñ¶W™' $Ô1À$ÔGð —‘“ˆŒÜ—I‘I—M‘M $§&¡&Ó)ˆŒ	ñ#&Ø!%§¢ó#&Ðð ××ô  ñ  EØ,0¯N©N×,AÑ,AÔ,Có Eó EØGHñIˆMà/<Ð<Ðä Ð!8Ù%MØ)-ô/�ô ˜f¤e×&6Ñ&6×7Ñ7Ø$5”MØ%¨Ñ*Ò%Ü ¬¯©×7Ó7Ø$0”MØ  AÑ%’Lò/ó 2�Ø×'Ñ'Ö)ñ 2ð �>�>àŸ™×-Ñ-Ö/�Ø—‘˜xÖ(ñ 0ð Ÿ™×-Ñ-Ö/�Ø—‘˜xÖ(ñ 0ð Ÿ™×-Ñ-Ö/�Ø—	‘	˜(Ö#ñ 0ô 	‰‰�XÕro   c                 ó®   • U R                  U R                  5       5      nUS   S   US   S   :„  nUS   S   US   S   :„  nUS   S   US   S   :„  nX#U4$ )Nr   r²   rØ   r   )rŸ   Ú
get_w_lims)re   ÚtcÚxhighÚyhighÚzhighs        rm   Úget_axis_positionÚAxes3D.get_axis_positionØ  sr   € Ø×#Ñ# D§O¡OÓ$5Ó6ˆØ�1‘�a‘˜2˜a™5 ™8Ñ#ˆØ�1‘�a‘˜2˜a™5 ™8Ñ#ˆØ�1‘�a‘˜2˜a™5 ™8Ñ#ˆØ˜UÐ"Ð"ro   c                 ó   • g)z;
Not implemented in `~mpl_toolkits.mplot3d.axes3d.Axes3D`.
NrÓ   )re   Úxysri   s      rm   Úupdate_datalimÚAxes3D.update_datalimß  s   € ð 	ro   Ú_get_autoscale_onÚ_set_autoscale_onc                 ó   • U R                   $ )z¦
Retrieve autoscaling margin of the z-axis.

.. versionadded:: 3.9

Returns
-------
zmargin : float

See Also
--------
mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin
)Ú_zmarginrt   s    rm   Úget_zmarginÚAxes3D.get_zmarginè  s   € ð �}‰}Ðro   c                 ób   • US::  a  [        S5      eXl        U R                  S5        SU l        g)a»  
Set padding of Z data limits prior to autoscaling.

*m* times the data interval will be added to each end of that interval
before it is used in autoscaling.  If *m* is negative, this will clip
the data range instead of expanding it.

For example, if your data is in the range [0, 2], a margin of 0.1 will
result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range
of [0.2, 1.8].

Parameters
----------
m : float greater than -0.5
g      à¿z margin must be greater than -0.5r   TN)rÝ   r0  Ú_request_autoscale_viewrs   )re   Úms     rm   Úset_zmarginÚAxes3D.set_zmarginø  s1   € ð  �‹9ÜÐ?Ó@Ð@ØŒØ×$Ñ$ SÔ)Øˆ�
ro   )r   r   r   Útightc                óö  • U(       a  Uc  Uc  Ub  [        S5      e[        U5      S:X  a	  US   =n=p#O'[        U5      S:X  a  Uu  pnOU(       a  [        S5      eUcI  UcF  UcC  USLa  [        R                  " SU< S	35        U R                  U R
                  U R                  4$ Ub  U R                  U5        Ub  U R                  U5        Ub  U R                  U5        U R                  XASLUSLUSLS
9  g)zÉ
Set or retrieve autoscaling margins.

See `.Axes.margins` for full documentation.  Because this function
applies to 3D Axes, it also takes a *z* argument, and returns
``(xmargin, ymargin, zmargin)``.
NzECannot pass both positional and keyword arguments for x, y, and/or z.r   r   rØ   zYMust pass a single positional argument for all margins, or one for each margin (x, y, z).Tzignoring tight=z in get mode)r8  ÚscalexÚscaleyÚscalez)Ú	TypeErrorÚlenr   Úwarn_externalÚ_xmarginÚ_ymarginr0  Úset_xmarginÚset_ymarginr6  rQ   )re   r   r   r   r8  Úmarginss         rm   rD  ÚAxes3D.margins  s  € ö ˜™¨©¸!¹-Üð <ó =ð =ä�‹\˜QÓØ ™
Ð"ˆAÐ"��AÜ�‹\˜QÓØ‰GˆA‘!ÞÜð Ió Jð Jð ‰9˜™ q¡yØ˜DÒ Ü×"Ò" _°U±I¸\Ð#JÔKØ—=‘= $§-¡-°·±Ð>Ð>à‰=Ø×Ñ˜QÔØ‰=Ø×Ñ˜QÔØ‰=Ø×Ñ˜QÔà×ÑØ¨$ ¸À$¸Ø˜T�Mð 	ò 	
ro   c                 ó   • Uc  SnSnSnO~US;   a"  U R                  U5        U R                  5       nOSnUS;   a"  U R                  U5        U R                  5       nOSnUS;   a"  U R	                  U5        U R                  5       nOSnU(       a  U R                  SUS9  U(       a  U R                  S	US9  U(       a  U R                  S
US9  gg)zç
Convenience method for simple axis view autoscaling.

See `.Axes.autoscale` for full documentation.  Because this function
applies to 3D Axes, *axis* can also be set to 'z', and setting *axis*
to 'both' autoscales all three axes.
NT)r   ÚbothF)r   rG  ©r   rG  r   )r8  r   r   )Úset_autoscalex_onÚget_autoscalex_onÚset_autoscaley_onÚget_autoscaley_onÚset_autoscalez_onÚget_autoscalez_onr4  )re   Úenabler®   r8  r:  r;  r<  s          rm   Ú	autoscaleÚAxes3D.autoscale2  sÚ   € ð ‰>ØˆFØˆFØ‰Fà�}Ó$Ø×&Ñ& vÔ.Ø×/Ñ/Ó1‘à�Ø�}Ó$Ø×&Ñ& vÔ.Ø×/Ñ/Ó1‘à�Ø�}Ó$Ø×&Ñ& vÔ.Ø×/Ñ/Ó1‘à�ÞØ×(Ñ(¨°EÐ(Ñ:ÞØ×(Ñ(¨°EÐ(Ñ:ÞØ×(Ñ(¨°EÐ(Ò:ð ro   c                 ó  • [         R                  " U5      [         R                  " U5      :X  a`  U R                  R                  [         R                  " [         R
                  " U5      [         R
                  " U5      /5      U(       + 5        O@U R                  R                  X(       + 5        U R                  R                  X$(       + 5        Ub   U R                  R                  X4(       + 5        U R                  5         g rû   )
r·   Úshaper@   Úupdate_from_data_xyÚcolumn_stackÚravelÚupdate_from_data_xÚupdate_from_data_yrA   rQ   )re   ÚXÚYÚZÚhad_datas        rm   Úauto_scale_xyzÚAxes3D.auto_scale_xyzU  s£   € ô �8Š8�A‹;œ"Ÿ(š( 1›+Ó%Ø�O‰O×/Ñ/Ü—’¤§¢¨!£¬b¯hªh°q«kÐ :Ó;À¼\õKð �O‰O×.Ñ.¨q´,Ô?Ø�O‰O×.Ñ.¨q´,Ô?Ø‰=Ø�O‰O×.Ñ.¨q´,Ô?à×ÑÕro   c                 óª  • Uc}  U R                   nU(       di  U R                   HY  n[        U[        R                  5      (       a  SnM&  [        U[
        R                  [        R                  45      (       d  MW  Sn  O   O[        U5      =oPl         U(       a¹  U R                  5       (       a¤  U R                  R                  u  pxU R                  R                  5       n	U	R                  Xx5      u  pxU R                   S:”  a  X‡-
  U R                   -  n
Xz-  nXŠ-  nU(       d  U	R#                  Xx5      u  pxU R%                  XxU R&                  5        U(       a¹  U R)                  5       (       a¤  U R                  R*                  u  p¼U R,                  R                  5       nUR                  X¼5      u  p¼U R.                  S:”  a  XË-
  U R.                  -  n
Xº-  nXÊ-  nU(       d  UR#                  X¼5      u  p¼U R1                  X¼U R&                  5        U(       a»  U R3                  5       (       a¥  U R4                  R                  u  pïU R6                  R                  5       nUR                  Xï5      u  pïU R8                  S:”  a  Xþ-
  U R8                  -  n
Xê-  nXú-  nU(       d  UR#                  Xï5      u  pïU R;                  XïU R&                  5        ggg)z´
Autoscale the view limits using the data limits.

See `.Axes.autoscale_view` for full documentation.  Because this
function applies to 3D Axes, it also takes a *scalez* argument.
NTFr   )Ú_tightr  rü   ÚmimageÚ	AxesImageÚmlinesÚLine2Drÿ   r   ÚboolrJ  r@   r�   rŠ   Úget_major_locatorÚnonsingularr@  Úview_limitsÚ
set_xboundrP   rL  r‚   rŒ   rA  Ú
set_yboundrN  rA   rz   r0  Ú
set_zbound)re   r8  r:  r;  r<  r`  r  Úx0Úx1ÚxlocatorÚdeltaÚy0Úy1ÚylocatorÚz0Úz1Úzlocators                    rm   rQ   ÚAxes3D.autoscale_viewc  s@  € ð ‰=Ø—[‘[ˆFÞà"Ÿnœn�FÜ! &¬&×*:Ñ*:×;Ñ;Ø!%šÜ# F¬V¯]©]¼H¿N¹NÐ,K×LÓLØ!&˜Ùñ -øô $(¨£;Ð.ˆF”[æ�d×,Ñ,×.Ñ.Ø—_‘_×.Ñ.‰FˆBØ—z‘z×3Ñ3Ó5ˆHØ×)Ñ)¨"Ó1‰FˆBØ�}‰}˜qÓ Ø™ D§M¡MÑ1�Ø‘�Ø‘�ÞØ!×-Ñ-¨bÓ5‘�Ø�O‰O˜B D×$5Ñ$5Ô6æ�d×,Ñ,×.Ñ.Ø—_‘_×.Ñ.‰FˆBØ—z‘z×3Ñ3Ó5ˆHØ×)Ñ)¨"Ó1‰FˆBØ�}‰}˜qÓ Ø™ D§M¡MÑ1�Ø‘�Ø‘�ÞØ!×-Ñ-¨bÓ5‘�Ø�O‰O˜B D×$5Ñ$5Ô6æ�d×,Ñ,×.Ñ.Ø—_‘_×.Ñ.‰FˆBØ—z‘z×3Ñ3Ó5ˆHØ×)Ñ)¨"Ó1‰FˆBØ�}‰}˜qÓ Ø™ D§M¡MÑ1�Ø‘�Ø‘�ÞØ!×-Ñ-¨bÓ5‘�Ø�O‰O˜B D×$5Ñ$5Õ6ð /ˆ6ro   c                 óx   • U R                  5       u  pU R                  5       u  p4U R                  5       u  pVXX4XV4$ )zGet 3D world limits.)Ú
get_xlim3dÚ
get_ylim3dÚ
get_zlim3d)re   r˜   r™   rš   r›   rœ   r�   s          rm   r"  ÚAxes3D.get_w_limsž  s9   € à—_‘_Ó&‰
ˆØ—_‘_Ó&‰
ˆØ—_‘_Ó&‰
ˆØ˜4 tÐ1Ð1ro   c           	      ó¬   • Uc  [         R                  " U5      (       a  Uu  pEU" 5       u  pxUc  UnUc  UnU" [        XE4[        U" 5       5      S9SUS9  g)z
Set 3D axis bounds.
NrÛ   r°   )r·   Úiterabler  re  )	re   Ú	get_boundrË   Úaxis_invertedÚlowerÚupperr±   Ú	old_lowerÚ	old_uppers	            rm   Ú_set_bound3dÚAxes3D._set_bound3d¥  s[   € ð
 ‰=œRŸ[š[¨×/Ñ/Ø ‰LˆEá(›{Ñˆ	Ø‰=ØˆEØ‰=ØˆEá”˜�~¬t±M³OÓ/DÑEØ {ó	4ro   c                 ój   • U R                  U R                  U R                  U R                  XU5        g)a  
Set the lower and upper numerical bounds of the x-axis.

This method will honor axis inversion regardless of parameter order.
It will not change the autoscaling setting (`.get_autoscalex_on()`).

Parameters
----------
lower, upper : float or None
    The lower and upper bounds. If *None*, the respective axis bound
    is not modified.
view_margin : float or None
    The margin to apply to the bounds. If *None*, the margin is handled
    by `.set_xlim`.

See Also
--------
get_xbound
get_xlim, set_xlim
invert_xaxis, xaxis_inverted
N)r„  Ú
get_xboundÚset_xlimÚxaxis_inverted©re   r€  r�  r±   s       rm   ri  ÚAxes3D.set_xbound¶  ó+   € ð, 	×Ñ˜$Ÿ/™/¨4¯=©=¸$×:MÑ:MØ¨õ	5ro   c                 ój   • U R                  U R                  U R                  U R                  XU5        g)a  
Set the lower and upper numerical bounds of the y-axis.

This method will honor axis inversion regardless of parameter order.
It will not change the autoscaling setting (`.get_autoscaley_on()`).

Parameters
----------
lower, upper : float or None
    The lower and upper bounds. If *None*, the respective axis bound
    is not modified.
view_margin : float or None
    The margin to apply to the bounds. If *None*, the margin is handled
    by `.set_ylim`.

See Also
--------
get_ybound
get_ylim, set_ylim
invert_yaxis, yaxis_inverted
N)r„  Ú
get_yboundÚset_ylimÚyaxis_invertedrŠ  s       rm   rj  ÚAxes3D.set_yboundÏ  rŒ  ro   c                 ój   • U R                  U R                  U R                  U R                  XU5        g)a  
Set the lower and upper numerical bounds of the z-axis.
This method will honor axis inversion regardless of parameter order.
It will not change the autoscaling setting (`.get_autoscaley_on()`).

Parameters
----------
lower, upper : float or None
    The lower and upper bounds. If *None*, the respective axis bound
    is not modified.
view_margin : float or None
    The margin to apply to the bounds. If *None*, the margin is handled
    by `.set_zlim`.

See Also
--------
get_zbound
get_zlim, set_zlim
invert_zaxis, zaxis_inverted
N)r„  Ú
get_zboundÚset_zlimÚzaxis_invertedrŠ  s       rm   rk  ÚAxes3D.set_zboundè  s+   € ð* 	×Ñ˜$Ÿ/™/¨4¯=©=¸$×:MÑ:MØ¨õ	5ro   ©Úemitr¢   r±   ÚaxminÚaxmaxc                ó  • Uc6  [         R                  " U5      (       a  Uu  p#OUc  UR                  5       S   nUc  Uc  UR                  5       S   nUb  Ub  [        S5      eUnUb  Ub  [        S5      eUn[         R                  " U5      (       d  [         R                  " U5      (       a  [        SU SU S35      eUc'  [        R                  S   (       a  U R                  nOSnX2-
  U-  n	X)-  nX9-  nUR                  X#XES	9$ )
z
Set 3D axis limits.
r   r   z"Cannot pass both 'lower' and 'min'z"Cannot pass both 'upper' and 'max'zAxis limits z, z cannot be infinitezaxes3d.automargin©r˜  r¢   )
r·   r}  r¹   r=  ÚisinfrÝ   ÚmplÚrcParamsrP   Ú_set_lim)
re   r®   r€  r�  r˜  r¢   r±   r™  rš  ro  s
             rm   Ú
_set_lim3dÚAxes3D._set_lim3d   s  € ð
 ‰=Ü�{Š{˜5×!Ñ!Ø$‘��uØ‘Ø×.Ñ.Ó0°Ñ3�Ø‰=˜U™]Ø×*Ñ*Ó,¨QÑ/ˆEØÑØÑ ÜÐ DÓEÐEØˆEØÑØÑ ÜÐ DÓEÐEØˆEÜ�8Š8�E�?‰?œbŸhšh uŸo™oÜ˜|¨E¨7°"°U°GÐ;NÐOÓPÐPØÑÜ�|‰|Ð/×0Ø"×/Ñ/‘à�Ø‘ +Ñ-ˆØ‰ˆØ‰ˆØ�}‰}˜U°ˆ}Ð@Ð@ro   )r˜  r¢   r±   ÚxminÚxmaxc                ó<   • U R                  U R                  XX4XVUS9$ )aÈ  
Set the 3D x-axis view limits.

Parameters
----------
left : float, optional
    The left xlim in data coordinates. Passing *None* leaves the
    limit unchanged.

    The left and right xlims may also be passed as the tuple
    (*left*, *right*) as the first positional argument (or as
    the *left* keyword argument).

    .. ACCEPTS: (left: float, right: float)

right : float, optional
    The right xlim in data coordinates. Passing *None* leaves the
    limit unchanged.

emit : bool, default: True
    Whether to notify observers of limit change.

auto : bool or None, default: False
    Whether to turn on autoscaling of the x-axis. *True* turns on,
    *False* turns off, *None* leaves unchanged.

view_margin : float, optional
    The additional margin to apply to the limits.

xmin, xmax : float, optional
    They are equivalent to left and right respectively, and it is an
    error to pass both *xmin* and *left* or *xmax* and *right*.

Returns
-------
left, right : (float, float)
    The new x-axis limits in data coordinates.

See Also
--------
get_xlim
set_xbound, get_xbound
invert_xaxis, xaxis_inverted

Notes
-----
The *left* value may be greater than the *right* value, in which
case the x-axis values will decrease from *left* to *right*.

Examples
--------
>>> set_xlim(left, right)
>>> set_xlim((left, right))
>>> left, right = set_xlim(left, right)

One limit may be left unchanged.

>>> set_xlim(right=right_lim)

Limits may be passed in reverse order to flip the direction of
the x-axis. For example, suppose ``x`` represents depth of the
ocean in m. The x-axis limits might be set like the following
so 5000 m depth is at the left of the plot and the surface,
0 m, is at the right.

>>> set_xlim(5000, 0)
r—  )r¡  rŠ   )re   ÚleftÚrightr˜  r¢   r±   r£  r¤  s           rm   rˆ  ÚAxes3D.set_xlim   s,   € ðJ �‰˜tŸz™z¨4¸TØ+6È$ð ð Pð 	Pro   )r˜  r¢   r±   ÚyminÚymaxc                ó<   • U R                  U R                  XX4XVUS9$ )aÆ  
Set the 3D y-axis view limits.

Parameters
----------
bottom : float, optional
    The bottom ylim in data coordinates. Passing *None* leaves the
    limit unchanged.

    The bottom and top ylims may also be passed as the tuple
    (*bottom*, *top*) as the first positional argument (or as
    the *bottom* keyword argument).

    .. ACCEPTS: (bottom: float, top: float)

top : float, optional
    The top ylim in data coordinates. Passing *None* leaves the
    limit unchanged.

emit : bool, default: True
    Whether to notify observers of limit change.

auto : bool or None, default: False
    Whether to turn on autoscaling of the y-axis. *True* turns on,
    *False* turns off, *None* leaves unchanged.

view_margin : float, optional
    The additional margin to apply to the limits.

ymin, ymax : float, optional
    They are equivalent to bottom and top respectively, and it is an
    error to pass both *ymin* and *bottom* or *ymax* and *top*.

Returns
-------
bottom, top : (float, float)
    The new y-axis limits in data coordinates.

See Also
--------
get_ylim
set_ybound, get_ybound
invert_yaxis, yaxis_inverted

Notes
-----
The *bottom* value may be greater than the *top* value, in which
case the y-axis values will decrease from *bottom* to *top*.

Examples
--------
>>> set_ylim(bottom, top)
>>> set_ylim((bottom, top))
>>> bottom, top = set_ylim(bottom, top)

One limit may be left unchanged.

>>> set_ylim(top=top_lim)

Limits may be passed in reverse order to flip the direction of
the y-axis. For example, suppose ``y`` represents depth of the
ocean in m. The y-axis limits might be set like the following
so 5000 m depth is at the bottom of the plot and the surface,
0 m, is at the top.

>>> set_ylim(5000, 0)
r—  )r¡  rŒ   )re   ÚbottomÚtopr˜  r¢   r±   r©  rª  s           rm   r�  ÚAxes3D.set_ylimh  ó,   € ðJ �‰˜tŸz™z¨6¸TØ+6È$ð ð Pð 	Pro   )r˜  r¢   r±   ÚzminÚzmaxc                ó<   • U R                  U R                  XX4XVUS9$ )aÆ  
Set the 3D z-axis view limits.

Parameters
----------
bottom : float, optional
    The bottom zlim in data coordinates. Passing *None* leaves the
    limit unchanged.

    The bottom and top zlims may also be passed as the tuple
    (*bottom*, *top*) as the first positional argument (or as
    the *bottom* keyword argument).

    .. ACCEPTS: (bottom: float, top: float)

top : float, optional
    The top zlim in data coordinates. Passing *None* leaves the
    limit unchanged.

emit : bool, default: True
    Whether to notify observers of limit change.

auto : bool or None, default: False
    Whether to turn on autoscaling of the z-axis. *True* turns on,
    *False* turns off, *None* leaves unchanged.

view_margin : float, optional
    The additional margin to apply to the limits.

zmin, zmax : float, optional
    They are equivalent to bottom and top respectively, and it is an
    error to pass both *zmin* and *bottom* or *zmax* and *top*.

Returns
-------
bottom, top : (float, float)
    The new z-axis limits in data coordinates.

See Also
--------
get_zlim
set_zbound, get_zbound
invert_zaxis, zaxis_inverted

Notes
-----
The *bottom* value may be greater than the *top* value, in which
case the z-axis values will decrease from *bottom* to *top*.

Examples
--------
>>> set_zlim(bottom, top)
>>> set_zlim((bottom, top))
>>> bottom, top = set_zlim(bottom, top)

One limit may be left unchanged.

>>> set_zlim(top=top_lim)

Limits may be passed in reverse order to flip the direction of
the z-axis. For example, suppose ``z`` represents depth of the
ocean in m. The z-axis limits might be set like the following
so 5000 m depth is at the bottom of the plot and the surface,
0 m, is at the top.

>>> set_zlim(5000, 0)
r—  )r¡  rz   )re   r¬  r­  r˜  r¢   r±   r°  r±  s           rm   r”  ÚAxes3D.set_zlim°  r¯  ro   c                 ó@   • [        U R                  R                  5      $ rû   )Útupler>   r�   rt   s    rm   Úget_xlimÚAxes3D.get_xlimü  ó   € ä�T—_‘_×.Ñ.Ó/Ð/ro   c                 ó@   • [        U R                  R                  5      $ rû   )rµ  r>   r‚   rt   s    rm   Úget_ylimÚAxes3D.get_ylim   r¸  ro   c                 ó@   • [        U R                  R                  5      $ )aD  
Return the 3D z-axis view limits.

Returns
-------
left, right : (float, float)
    The current z-axis limits in data coordinates.

See Also
--------
set_zlim
set_zbound, get_zbound
invert_zaxis, zaxis_inverted

Notes
-----
The z-axis may be inverted, in which case the *left* value will
be greater than the *right* value.
)rµ  r?   r�   rt   s    rm   Úget_zlimÚAxes3D.get_zlim  s   € ô( �T—_‘_×.Ñ.Ó/Ð/ro   Ú	get_scalerŠ   Ú_set_axes_scalerŒ   a“  
        Set the {}-axis scale.

        Parameters
        ----------
        value : {{"linear"}}
            The axis scale type to apply.  3D Axes currently only support
            linear scales; other scales yield nonsensical results.

        **kwargs
            Keyword arguments are nominally forwarded to the scale class, but
            none of them is applicable for linear scales.
        Úget_ticklocsÚ	set_ticksÚget_majorticklabelsÚget_minorticklabelsÚget_ticklabelsÚset_ticklabelszAxis.set_tickszAxes3D.set_zticks)Údoc_subÚ	axis_datez»

        Notes
        -----
        This function is merely provided for completeness, but 3D Axes do not
        support dates for ticks, and so this may not work as expected.
        c                 ó   • g)z:Currently not implemented for 3D Axes, and returns *None*.NrÓ   )re   rh   ri   s      rm   ÚclabelÚAxes3D.clabelC  ó   € àro   c                 ó®  • SU l         Uc  U R                  nUc  U R                  nUc  U R                  n[        R
                  " [        U R                  5       VVs0 s H  u  pgXv_M	     snnUS9nU(       a.  U R                  S   R                  U 5       Vs1 s H  oˆiM     n	nOU /n	U	 H  n
Xl
        X*l        X:l        XJl        M     gs  snnf s  snf )aš  
Set the elevation and azimuth of the Axes in degrees (not radians).

This can be used to rotate the Axes programmatically.

To look normal to the primary planes, the following elevation and
azimuth angles can be used. A roll angle of 0, 90, 180, or 270 deg
will rotate these views while keeping the axes at right angles.

==========   ====  ====
view plane   elev  azim
==========   ====  ====
XY           90    -90
XZ           0     -90
YZ           0     0
-XY          -90   90
-XZ          0     90
-YZ          0     180
==========   ====  ====

Parameters
----------
elev : float, default: None
    The elevation angle in degrees rotates the camera above the plane
    pierced by the vertical axis, with a positive angle corresponding
    to a location above that plane. For example, with the default
    vertical axis of 'z', the elevation defines the angle of the camera
    location above the x-y plane.
    If None, then the initial value as specified in the `Axes3D`
    constructor is used.
azim : float, default: None
    The azimuthal angle in degrees rotates the camera about the
    vertical axis, with a positive angle corresponding to a
    right-handed rotation. For example, with the default vertical axis
    of 'z', a positive azimuth rotates the camera about the origin from
    its location along the +x axis towards the +y axis.
    If None, then the initial value as specified in the `Axes3D`
    constructor is used.
roll : float, default: None
    The roll angle in degrees rotates the camera about the viewing
    axis. A positive angle spins the camera clockwise, causing the
    scene to rotate counter-clockwise.
    If None, then the initial value as specified in the `Axes3D`
    constructor is used.
vertical_axis : {"z", "x", "y"}, default: "z"
    The axis to align vertically. *azim* rotates about this axis.
share : bool, default: False
    If ``True``, apply the settings to all Axes with shared views.
é
   N)Úvertical_axisr   )r   r:   r9   r;   r   Úcheck_getitemr¾   Ú_axis_namesrD   Úget_siblingsr"   r#   r$   Ú_vertical_axis)re   r"   r#   r$   rÏ  r«   ÚidxÚnameÚsiblingÚaxesÚaxs              rm   rB   ÚAxes3D.view_initG  så   € ðh ˆŒ
à‰<Ø×$Ñ$ˆDØ‰<Ø×$Ñ$ˆDØ‰<Ø×$Ñ$ˆDÜ×*Ò*Ü(1°$×2BÑ2BÔ(CÔDÒ(C™9˜3ˆTŠYÑ(CÒDØ'ñ
ˆö
 à×(Ñ(¨Ñ0×=Ñ=¸dÔCóEÚCð !(’GÙCð ð EˆDð �6ˆDãˆBØŒGØŒGØŒGØ -Öò	 ùó Eùò
Es   ÁC
ÂCc                 óú   • [         R                  " SS/US9  US:X  a"  Uc  SnOUS::  a  [        SU S35      eX l        gUS[        R
                  4;  a  [        SU S	U 35      e[        R
                  U l        g)
ax  
Set the projection type.

Parameters
----------
proj_type : {'persp', 'ortho'}
    The projection type.
focal_length : float, default: None
    For a projection type of 'persp', the focal length of the virtual
    camera. Must be > 0. If None, defaults to 1.
    The focal length can be computed from a desired Field Of View via
    the equation: focal_length = 1/tan(FOV/2)
r!   Úortho)r'   Nr   r   zfocal_length = z must be greater than 0z must be None for proj_type = )r   r³   rÝ   Ú_focal_lengthr·   Úinf)re   r'   r(   s      rm   r<   ÚAxes3D.set_proj_type”  sš   € ô 	×Ò˜G WÐ-¸ÒCØ˜ÓØÑ#Ø ‘Ø Ó"Ü  ?°<°.ð A2ð "2ó 3ð 3à!-Õà D¬"¯&©& >Ó1Ü  ?°<°.ð A9Ø9B¸ð"Eó Fð Fä!#§¡ˆDÕro   Úarrznp.typing.ArrayLikerÜ   Úreturnc                 ó¢   • U(       a&  [         R                  " XR                  S-
  S-  5      $ [         R                  " XR                  S-
  5      $ )z³
Roll arrays to match the different vertical axis.

Parameters
----------
arr : ArrayLike
    Array to roll.
reverse : bool, default: False
    Reverse the direction of the roll.
r²   éÿÿÿÿ)r·   r$   rÓ  )re   rß  rÜ   s      rm   rá   ÚAxes3D._roll_to_vertical°  s@   € ö Ü—7’7˜3×!4Ñ!4°qÑ!8¸BÑ >Ó?Ð?ä—7’7˜3×!4Ñ!4°qÑ!8Ó:Ð:ro   c                 óÀ  • U R                  U R                  5      n[        R                  " / U R	                  5       QU R                  5       QU R                  5       Q7SU06nSU-  n[        R                  " U R                  5      n[        R                  " U R                  5      n[        R                  " U5      [        R                  " U5      -  n[        R                  " U5      [        R                  " U5      -  n[        R                  " U5      nU R                  XgU/5      n	X0R                  U	-  -   n
U R                  U
5      u  p¼nX°l        XÀl        XÐl        U R$                  [        R&                  :X  aD  [        R(                  " X¼XÚ5      n[        R*                  " U R                  * U R                  5      nOmX0R                  U	-  U R$                  -  -   n[        R(                  " X¼UU5      n[        R,                  " U R                  * U R                  U R$                  5      n[        R.                  " Xâ5      n[        R.                  " UU5      nU$ )z?Create the projection matrix from the current viewing position.Ú	pb_aspectç      à?)rá   r½   r   Úworld_transformationrx  ry  rz  r·   Údeg2radr"   r#   ÚcosÚsinr   Ú_calc_view_axesÚ_view_uÚ_view_vÚ_view_wrÜ  rÝ  Ú_view_transformation_uvwÚ_ortho_transformationÚ_persp_transformationÚdot)re   r)   ÚworldMÚRÚelev_radÚazim_radÚp0Úp1Úp2ÚpsÚeyeÚuÚvÚwÚviewMÚprojMÚ	eye_focalÚM0rN   s                      rm   r  ÚAxes3D.get_projÂ  sé  € ð ×+Ñ+¨D×,<Ñ,<Ó=ˆ
Ü×,Ò,ð 
Ø�_‰_Óð
à�_‰_Óð
ð �_‰_Óò
ð !ñ	
ˆð �*Ñˆô —:’:˜dŸi™iÓ(ˆÜ—:’:˜dŸi™iÓ(ˆÜ�VŠV�HÓ¤§¢ xÓ 0Ñ0ˆÜ�VŠV�HÓ¤§¢ xÓ 0Ñ0ˆÜ�VŠV�HÓˆð ×#Ñ# R¨R LÓ1ˆð —*‘*˜r‘/Ñ!ˆð ×&Ñ& sÓ+‰ˆˆaØŒØŒØŒð ×Ñ¤§¡Ó'ä×3Ò3°A¸!ÓAˆEÜ×0Ò0°$·*±*°¸d¿j¹jÓI‰Eð ŸJ™J¨™O¨d×.@Ñ.@Ñ@Ñ@ˆIÜ×3Ò3°A¸!¸YÓGˆEÜ×0Ò0°$·*±*°Ø15·±Ø15×1CÑ1CóEˆEô
 �VŠV�EÓ"ˆÜ�FŠF�5˜"ÓˆØˆro   c                 ó  • SU l         [        R                  " U5      R                  5       U l        [        R                  " U5      R                  5       U l        [        R                  " U5      R                  5       U l        g)a…  
Set the mouse buttons for 3D rotation and zooming.

Parameters
----------
rotate_btn : int or list of int, default: 1
    The mouse button or buttons to use for 3D rotation of the Axes.
pan_btn : int or list of int, default: 2
    The mouse button or buttons to use to pan the 3D Axes.
zoom_btn : int or list of int, default: 3
    The mouse button or buttons to use to zoom the 3D Axes.
N)Úbutton_pressedr·   Ú
atleast_1dÚtolistÚ_rotate_btnÚ_pan_btnÚ	_zoom_btn)re   Ú
rotate_btnÚpan_btnÚzoom_btns       rm   rS   ÚAxes3D.mouse_initý  sZ   € ð #ˆÔô Ÿ=š=¨Ó4×;Ñ;Ó=ˆÔÜŸš gÓ.×5Ñ5Ó7ˆŒÜŸš xÓ0×7Ñ7Ó9ˆ�ro   c                 ó&   • U R                  / / / S9  g)z<Disable mouse buttons for 3D rotation, panning, and zooming.)r  r  r  N)rS   rt   s    rm   Údisable_mouse_rotationÚAxes3D.disable_mouse_rotation  s   € à�‰ 2¨r¸BˆÒ?ro   c                 ó   • grw   rÓ   rt   s    rm   Úcan_zoomÚAxes3D.can_zoom  rÌ  ro   c                 ó   • grw   rÓ   rt   s    rm   Úcan_panÚAxes3D.can_pan  rÌ  ro   c                 ó
  • [         R                  " [        US9  U R                  b  XR                  La  [	        S5      eU R
                  S   R                  X5        Xl        UR                  R                  U R                  l        UR                  R                  U R                  l	        UR                  5       u  p#U R                  X#SUR                  5       S9  UR                  R                  U R                  l        g)zç
Share the z-axis with *other*.

This is equivalent to passing ``sharez=other`` when constructing the
Axes, and cannot be used if the z-axis is already being shared with
another Axes.  Note that it is not possible to unshare axes.
©ÚotherNzz-axis is already sharedr   Frœ  )r   Úcheck_isinstancer   rC   rÝ   rD   rE   rz   ÚmajorÚminorr½  r”  rN  Ú_scale)re   r  rs  rt  s       rm   r&   ÚAxes3D.sharez  s¼   € ô 	×Òœf¨EÒ2Ø�<‰<Ñ#¨·\±\Ò(AÜÐ7Ó8Ð8Ø×Ñ˜#Ñ×#Ñ# DÔ0ØŒØ Ÿ;™;×,Ñ,ˆ�
‰
ÔØ Ÿ;™;×,Ñ,ˆ�
‰
ÔØ—‘Ó!‰ˆØ�‰�b 5¨u×/FÑ/FÓ/HˆÑIØ!ŸK™K×.Ñ.ˆ�
‰
Õro   c                 ó^  • [         R                  " [        US9  U R                  b  XR                  La  [	        S5      eU R
                  S   R                  X5        Xl        U R                  UR                     nU R                  UR                  UR                  UR                  USS9  g)zõ
Share the view angles with *other*.

This is equivalent to passing ``shareview=other`` when constructing the
Axes, and cannot be used if the view angles are already being shared
with another Axes.  Note that it is not possible to unshare axes.
r  Nzview angles are already sharedr   T©r"   r#   r$   rÏ  r«   )r   r  r   rG   rÝ   rD   rE   rÑ  rÓ  rB   r"   r#   r$   )re   r  rÏ  s      rm   r%   ÚAxes3D.shareview1  s�   € ô 	×Òœf¨EÒ2Ø�?‰?Ñ&¨5¿¹Ò+GÜÐ=Ó>Ð>Ø×Ñ˜&Ñ!×&Ñ& tÔ3ØŒØ×(Ñ(¨×)=Ñ)=Ñ>ˆØ�‰˜EŸJ™J¨U¯Z©Z¸e¿j¹jØ%2¸$ð 	ò 	@ro   c                 ó~  >• [         TU ]  5         U R                  [        R                  :X  a  [
        R                  S   U l        OSU l        Sn[        X/SU-
  SU-
  //5      U l	        [        R                  " 5       U l        SU l        U R                  5         U R                  [
        R                  S   5        g )Nzaxes.zmarginr,   r.   r   r2   zaxes3d.grid)rJ   ÚclearrÜ  r·   rÝ  rž  rŸ  r0  r   r@   r=   rA   rP   rQ   Úgrid)re   rj   rl   s     €rm   r$  ÚAxes3D.clearB  s˜   ø€ ä‰‰ŒØ×Ñ¤§¡Ó'ÜŸL™L¨Ñ8ˆD�MàˆDŒMàˆÜ Ð 4Ø!" X¡¨q°8©|Ð <ð >ó ?ˆŒô Ÿ)š)›+ˆŒØ ˆÔØ×ÑÔà�	‰	”#—,‘,˜}Ñ-Õ.ro   c                 ót  • UR                   U :X  a¨  UR                  U l        UR                  UR                  sU l        U l        U R                  SS9R                  R                  nU(       a!  UR                  5       c  UR                  5         U(       a!  UR                  UR                  U5      5        g g g ©NTr3   )ÚinaxesÚbuttonr  ÚxdataÚydataÚ_sxÚ_syrT   rU   ÚtoolbarÚ
_nav_stackÚpush_currentÚset_messageÚ_mouse_event_to_message©re   Úeventr/  s      rm   rY   ÚAxes3D._button_pressT  s‘   € Ø�<‰<˜4ÓØ"'§,¡,ˆDÔØ!&§¡¨e¯k©kÐˆDŒH�d”hØ—o‘o¨4�oÐ0×7Ñ7×?Ñ?ˆGÞ˜7×-Ñ-Ó/Ñ7Ø×$Ñ$Ô&ÞØ×#Ñ# G×$CÑ$CÀEÓ$JÕKð ð  ro   c                 óø   • S U l         U R                  SS9R                  R                  nU(       a!  U R	                  5       c  UR                  5         U(       a!  UR                  UR                  U5      5        g g r(  )r  rT   rU   r/  Úget_navigate_moder1  r2  r3  r4  s      rm   rZ   ÚAxes3D._button_release^  sf   € Ø"ˆÔØ—/‘/ t�/Ð,×3Ñ3×;Ñ;ˆö �t×-Ñ-Ó/Ñ7Ø× Ñ Ô"ÞØ×Ñ × ?Ñ ?ÀÓ FÕGð ro   c                 ó  • U R                  5       U R                  5       U R                  5       U R                  5       U R	                  5       U R                  5       S.U R                  U R                  U R                  44$ )N)r   Úautoscalex_onr   Úautoscaley_onr   Úautoscalez_on)	r¶  rJ  rº  rL  r½  rN  r"   r#   r$   rt   s    rm   Ú	_get_viewÚAxes3D._get_viewh  sg   € ð —M‘M“O°d×6LÑ6LÓ6NØ—M‘M“O°d×6LÑ6LÓ6NØ—M‘M“O°d×6LÑ6LÓ6Nñ
ð �I‰I�t—y‘y $§)¡)Ð,ð	-ð 	-ro   c                 ó\   • Uu  nu  p4nU R                   " S0 UD6  X0l        X@l        XPl        g )NrÓ   )Úsetr"   r#   r$   )re   r   Úpropsr"   r#   r$   s         rm   Ú	_set_viewÚAxes3D._set_viewp  s/   € à$(Ñ!ˆÑ!�˜DØ�ŠÑ�5ÒØŒ	ØŒ	Ø�	ro   c                 ó®   •  U R                  U5      $ ! [        [        4 a1    U R                  R	                  5       R
                  nU" U5      nUs $ f = f)zš
Return *z* string formatted.  This function will use the
:attr:`fmt_zdata` attribute if it is callable, else will fall
back on the zaxis major formatter
)rR   rI   r=  rz   Úget_major_formatterÚformat_data_short)re   r   ÚfuncÚvals       rm   Úformat_zdataÚAxes3D.format_zdatax  sP   € ð	Ø—>‘> !Ó$Ð$øÜ¤	Ð*ó 	Ø—:‘:×1Ñ1Ó3×EÑEˆDÙ�q“'ˆCØŠJð	ús   ‚ “>AÁAc                 ó    • SnU R                   U R                  ;   a  U R                  5       nU$ U R                  b  U R	                  XU5      nU$ )z¿
Return a string giving the current view rotation angles, or the x, y, z
coordinates of the point on the nearest axis pane underneath the mouse
cursor, depending on the mouse button pressed.
Ú )r  r  Ú_rotation_coordsrN   Ú_location_coords)re   ÚxvÚyvr  Úcoordss        rm   Úformat_coordÚAxes3D.format_coord…  sU   € ð ˆà×Ñ $×"2Ñ"2Ó2à×*Ñ*Ó,ˆFð
 ˆð �V‰VÑØ×*Ñ*¨2°8Ó<ˆFàˆro   c                 ó  • [         R                  " U R                  5      n[         R                  " U R                  5      n[         R                  " U R                  5      nSUS SUS SUS S3R                  SS5      nU$ )z)
Return the rotation angles as a string.
z
elevation=z.0fu   Â°, azimuth=u	   Â°, roll=ô   Â°Ú-u   âˆ’)r   Ú_norm_angler"   r#   r$   Úreplace)re   Ú	norm_elevÚ	norm_azimÚ	norm_rollrR  s        rm   rN  ÚAxes3D._rotation_coords–  sƒ   € ô ×%Ò% d§i¡iÓ0ˆ	Ü×%Ò% d§i¡iÓ0ˆ	Ü×%Ò% d§i¡iÓ0ˆ	Ø˜y¨˜oð .Ø& s˜Oð ,Ø# C˜¨ð9÷ ‘G˜CÐ!1Ó2ð 	ð ˆro   c                 ó  • U R                  XU5      u  pEU R                  US   5      nU R                  US   5      nU R                  US   5      nUS:X  a  SU SU SU 3n	U	$ US:X  a  SU SU SU 3n	U	$ US:X  a  SU SU S	U 3n	W	$ )
zI
Return the location on the axis pane underneath the cursor as a string.
r   r   r²   zx pane=z, y=z, z=zx=z	, y pane=z	, z pane=)Ú_calc_coordÚformat_xdataÚformat_ydatarJ  )
re   rP  rQ  r  rø  Úpane_idxÚxsÚysÚzsrR  s
             rm   rO  ÚAxes3D._location_coords£  sÈ   € ð ×'Ñ'¨°Ó9‰ˆØ×Ñ˜r !™uÓ%ˆØ×Ñ˜r !™uÓ%ˆØ×Ñ˜r !™uÓ%ˆØ�q‹=Ø˜r˜d $ r d¨$¨r¨dÐ3ˆFð
 ˆð	 ˜‹]Ø˜"˜˜Y r d¨$¨r¨dÐ3ˆFð ˆð ˜‹]Ø˜"˜˜T "  Y¨r¨dÐ3ˆFØˆro   c                 óD  • U R                  5       u  pp4pV[        R                  " XU/5      n[        R                  " XEU/5      nU R                  [        R                  :X  a  Sn	OU R                  n	XpR
                  U R                  -  U-  U R                  -  U	-  -   n
U
$ )z:
Returns the current camera location in data coordinates.
g    eÍÍA)Ú_get_w_centers_rangesr·   r¸   rÜ  rÝ  rî  r   r½   )re   ÚcxÚcyÚczÚdxÚdyÚdzÚcÚrr(   rû  s              rm   Ú_get_camera_locÚAxes3D._get_camera_loc³  sŽ   € ð "&×!;Ñ!;Ó!=Ñˆ�˜Ü�HŠH�b˜b�\Ó"ˆÜ�HŠH�b˜b�\Ó"ˆà×Ñ¤§¡Ó'Ø‰Là×-Ñ-ˆLØ—,‘, §¡Ñ+¨aÑ/°$×2BÑ2BÑBÀ\ÑQÑQˆØˆ
ro   c                 óœ  • U R                   [        R                  :X  a  SnOSU R                   -  n[        R                  " [        R
                  " XX@R                  5      5      R                  5       nU R                  5       U-
  n/ nU R                  R                  5        H&  nUR                  5       u  pšUR                  U
5        M(     [        R                  " S5      n[        S5       H/  nXl   S:X  a  [        R                  X¼'   M  X\   X|   -
  Xl   -  X¼'   M1     [        R                  " [!        U5      5      nX½   nX^U-  -
  nXý4$ )zœ
Given the 2D view coordinates, find the point on the nearest axis pane
that lies directly below those coordinates. Returns a 3D point in data
coordinates.
r   râ  rØ   r   )rÜ  r·   rÝ  r¸   r   Úinv_transformrO   rV  rq  r  r  Úactive_paneÚappendÚzerosÚrangeÚargminÚabs)re   rP  rQ  r  Úzvrø  ÚvecÚ	pane_locsr®   r*  ÚlocÚscalesrÊ   rb  rÈ   rù  s                   rm   r_  ÚAxes3D._calc_coordÂ  s  € ð ×Ñ¤§¡Ó'Ø‰Bà�d×(Ñ(Ñ(ˆBô �XŠX”f×*Ò*¨2°2·y±yÓAÓB×HÑHÓJˆð ×"Ñ"Ó$ rÑ)ˆð ˆ	Ø—N‘N×)Ñ)Ö+ˆDØ×'Ñ'Ó)‰HˆCØ×Ñ˜SÖ!ñ ,ô
 —’˜!“ˆÜ�q–ˆAØ‰v˜‹{ÜŸF™F�“	à™U Y¡\Ñ1°S±VÑ;�“	ñ	 ô
 —9’9œS ›[Ó)ˆØÑ ˆð ˜‘)‰^ˆØˆ|Ðro   r   r   c                 óN  • [         R                  S   S-  n[         R                  S   U-  nX-  nX#-  nX-  X"-  -   n[        R                  " U5      nSU-   nUSUS-  -   -  nSUSU-  -   -  n	Xi:  a1  [        R                  " [        R                  " SU-
  5      X/5      n
U
$ Xg:  a^  Xv-
  n[        R                  " U[        R                  " X‹-   X‹-
  -  5      -
  X/5      n
U
[        R
                  R                  U
5      -  n
U
$ [        R                  " SX-  X&-  /5      n
U
$ )a  
Convert a point (x, y) to a point on a virtual trackball.

This is Ken Shoemake's arcball (a sphere), modified
to soften the abrupt edge (optionally).
See: Ken Shoemake, "ARCBALL: A user interface for specifying
three-dimensional rotation using a mouse." in
Proceedings of Graphics Interface '92, 1992, pp. 151-156,
https://doi.org/10.20380/GI1992.18
The smoothing of the edge is inspired by Gavin Bell's arcball
(a sphere combined with a hyperbola), but here, the sphere
is combined with a section of a cylinder, so it has finite support.
úaxes3d.trackballsizer²   zaxes3d.trackballborderr   r   )rž  rŸ  r·   Úsqrtr¸   rÃ   rÄ   )re   r   r   ÚsÚbÚr2rp  ÚraÚaÚriÚpÚdrs               rm   Ú_arcballÚAxes3D._arcballç  s  € ô �L‰LÐ/Ñ0°1Ñ4ˆÜ�L‰LÐ1Ñ2°QÑ6ˆØ	‰ˆØ	‰ˆØ‰S�1‘3‰YˆÜ�GŠG�B‹KˆØ�‰UˆØ��Q�q‘S‘‰MˆØ��Q�r‘T‘	‰]ˆØ‹6Ü—’œ"Ÿ'š' ! b¡&›/¨1Ð0Ó1ˆAð ˆð ‹VØ‘ˆBÜ—’˜!œbŸgšg q¡v°!±&Ñ&9Ó:Ñ:¸AÐAÓBˆAØ”—‘—‘ Ó"Ñ"ˆAð ˆô —’˜!˜Q™S !¡#˜Ó'ˆAØˆro   c                 ó¨  • U R                   (       d  gU R                  5       b  gU R                  c  gUR                  UR                  p2Ub  UR
                  U :w  a  gX R                  -
  X0R                  -
  pTU R                  nU R                  nU R                   U R                  ;   Ga¤  US:X  a  US:X  a  g[        R                  S   nUS:X  aÈ  [        R                  " U R                  5      n	XW-  * S-  [        R                   " U	5      -  XF-  S-  [        R"                  " U	5      -  -   n
XW-  * S-  [        R"                  " U	5      -  XF-  S-  [        R                   " U	5      -  -
  nU R$                  U
-   nU R&                  U-   nU R                  n	GO‚[(        R*                  " [        R                  " U R$                  U R&                  U R                  45      6 nUS:X  a�  [        R,                  " SU* U-  XF-  /5      n[        R.                  R1                  U5      nU[        R                  S   -  n[)        [        R                   " U5      U[        R"                  " U5      -  U-  5      nOyU R3                  U R                  U-  U R                  U-  5      nU R3                  X&-  X7-  5      nUS:X  a  [(        R5                  UU5      nO[)        SU5      [)        SU* 5      -  nUU-  n[        R6                  " UR9                  5       5      u  pÍn	U R:                  U R<                     nU R?                  UUU	US	S
9  S	U l         OÎU R                   U RB                  ;   a€  U RD                  RG                  U R                  U R                  /5      u  nnU RI                  UUS5        U RK                  SSURL                  URN                  5        U RQ                  5         O4U R                   U RR                  ;   a  XwU-
  -  nU RU                  UUU5        X#sU l        U l        U RW                  S	S9RX                  R[                  5         g)z�
Mouse moving.

By default, button-1 rotates, button-2 pans, and button-3 zooms;
these buttons can be modified via `mouse_init`.
Nr   zaxes3d.mouserotationstyleÚazelé´   Ú	trackballr‚  ÚsphereTr!  r²   r3   ).r  r8  rN   r+  r,  r)  r-  r.  ra   rb   r  rž  rŸ  r·   rè  r$   ré  rê  r"   r#   Ú_QuaternionÚfrom_cardan_anglesr¸   rÃ   rÄ   rŒ  Úrotate_from_toÚrad2degÚas_cardan_anglesrÑ  rÓ  rB   rs   r	  Ú	transDatar`   Ú	start_panÚdrag_panr   r   Úend_panr
  Ú_scale_axis_limitsrT   rU   Ú	draw_idle)re   r5  r   r   rl  rm  rþ  ÚhÚstyler$   ÚdelevÚdazimr"   r#   ÚqÚkÚnkÚthÚdqÚcurrent_vecÚnew_vecrÏ  ÚpxÚpyrÈ   s                            rm   rX   ÚAxes3D._on_move  s‰  € ð ×"×"Øà×!Ñ!Ó#Ñ/ð à�6‰6‰>Øà�{‰{˜EŸK™Kˆ1à‰9˜Ÿ™¨Ó,Øà—X‘X‘˜q§8¡8™|ˆBØ�N‰NˆØ�N‰Nˆð ×Ñ $×"2Ñ"2Ô2ð �Q‹w˜2 ›7Øä—L‘LÐ!<Ñ=ˆEØ˜‹Ü—z’z $§)¡)Ó,�Ø™$˜ ™¤B§F¢F¨4£LÑ0°B±D¸#±:¼b¿fºfÀT»lÑ3JÑJ�Ø™$˜ ™¤B§F¢F¨4£LÑ0°B±D¸#±:¼b¿fºfÀT»lÑ3JÑJ�Ø—y‘y 5Ñ(�Ø—y‘y 5Ñ(�Ø—y‘y’ä×2Ò2ÜŸš T§Y¡Y°·	±	¸4¿9¹9Ð$EÓFðH�ð ˜KÓ'ÜŸš ! b S¨¡U¨B©DÐ!1Ó2�AÜŸ™Ÿ™¨Ó*�BØœcŸl™lÐ+AÑBÑB�BÜ$¤R§V¢V¨B£Z°´2·6²6¸"³:±¸b±ÓA‘Bà"&§-¡-°·±¸±
¸D¿H¹HÀQ¹JÓ"G�KØ"Ÿm™m¨A©C°±Ó5�GØ Ó(Ü(×7Ñ7¸ÀWÓM™ä(¨¨GÓ4´{À1À{ÀlÓ7SÑS˜à˜‘F�Ü#%§:¢:¨a×.@Ñ.@Ó.BÓ#CÑ �˜Dð !×,Ñ,¨T×-@Ñ-@ÑAˆMØ�N‰NØØØØ+Øð ñ ð ˆD�Jð × Ñ  D§M¡MÓ1à—^‘^×-Ñ-¨t¯x©x¸¿¹Ð.BÓC‰FˆB�Ø�N‰N˜2˜r 1Ô%à�M‰M˜!˜T 5§7¡7¨E¯G©GÔ4Ø�L‰L�Nð × Ñ  D§N¡NÓ2à˜2‘v‘JˆEØ×#Ñ# E¨5°%Ô8ð ÐˆŒ�$”(à�‰˜TˆÐ"×)Ñ)×3Ñ3Õ5ro   c                 ó  • U R                   nUR                  R                  X44UR                  UR                  4/5      u  u  pgu  p‰XgsU l        U l        U R                  X4U5        Xh-
  Xy-
  pºSnUS:X  a  SnOUS:X  a  Sn
U
S:X  a  US:X  a  g [        R                  " U R                  U R                  U R                  /5      nU* U R                  -  U R                  -  nUR                  [        R                  " X«U/5      -  nU R!                  5       u  nnnnnnUU-
  US   -  nUU-
  US   -  nUU-
  US   -  nU R#                  UU-   UU-   S S9  U R%                  UU-   UU-   S S9  U R'                  UU-   UU-   S S9  g )Nr   r   r   r   r²   ©r¢   )Ú
_pan_startÚtrans_inverser`   r   r   r-  r.  r™  r·   r¸   rì  rí  rî  r½   r   ÚTr"  r¿   rÀ   rÁ   )re   r*  r  r   r   rŠ  r+  r,  Úxdata_startÚydata_startÚduÚdvÚdwrô  Úduvw_projectedr˜   r™   rš   r›   rœ   r�   rl  rm  rn  s                           rm   rš  ÚAxes3D.drag_panf  s–  € ð �O‰OˆØ56·_±_×5NÑ5NØˆV�a—c‘c˜1Ÿ3™3�ZÐ ó6"Ñ2‰ˆÑ2˜à"ÐˆŒ�$”(ð 	�‰�q˜VÔ$ØÑ$ eÑ&9ˆBØˆØ�#‹:Ø‰BØ�C‹ZØˆBØ�‹7�r˜Q“wØô �HŠH�d—l‘l D§L¡L°$·,±,Ð?Ó@ˆØˆB�×!Ñ!Ñ! D§J¡JÑ.ˆØŸ™œrŸxšx¨°¨Ó5Ñ5ˆð .2¯_©_Ó->Ñ*ˆˆd�D˜$  dØ�T‰k˜^¨AÑ.Ñ.ˆØ�T‰k˜^¨AÑ.Ñ.ˆØ�T‰k˜^¨AÑ.Ñ.ˆð 	�‰˜˜r™	 4¨"¡9°4ˆÑ8Ø�‰˜˜r™	 4¨"¡9°4ˆÑ8Ø�‰˜˜r™	 4¨"¡9°4ˆÒ8ro   c                 óÖ  • [         R                  " [        R                  " U R                  5      5      n[         R                  " [        R                  " U R
                  5      5      nSU R                  U R                  5      -  n[         R                  " S5      n[        U5      [         R                  S-  :”  a  SOSXPR                  '   [        R                  " XXS5      u  pgnXgU4$ )z¥
Get the unit vectors for the viewing axes in data coordinates.
`u` is towards the right of the screen
`v` is towards the top of the screen
`w` is out of the screen
ræ  rØ   r²   râ  r   )r·   rè  r   rX  r"   r$   rá   r½   rw  rz  ÚpirÓ  r   Ú
_view_axes)	re   rû  rõ  Úroll_radrô  ÚVrü  rý  rþ  s	            rm   rë  ÚAxes3D._calc_view_axesŠ  s¬   € ô —:’:œe×/Ò/°·	±	Ó:Ó;ˆÜ—:’:œe×/Ò/°·	±	Ó:Ó;ˆð �$×(Ñ(¨×)9Ñ)9Ó:Ñ:ˆô
 �HŠH�Q‹KˆÜ'*¨8£}´r·u±u¸Q±wÓ'>¡ÀAˆ×
Ñ
Ñä×#Ò# C¨AÓ8‰ˆˆaØ�Qˆwˆro   c                 óò  • Uu  pgp‰US:X  a3  U R                   R                  S   nU R                   R                  S   n	O8US:X  a2  U R                   R                  S   nU R                   R                  S   n[        R                  " [        Xh/5      U R                   R                  S   U R                   R                  S   5      u  ph[        R                  " [        Xy/5      U R                   R                  S   U R                   R                  S   5      u  pyXh-   S-  n
Xy-   S-  nU R                   R                  S   U R                   R                  S   -   S-  nU R                   R                  S   U R                   R                  S   -   S-  nU R                  X«S5        U R                  SSXÍ5        U R                  5         [        Xh-
  5      n[        Xy-
  5      nXàR                   R                  S   U R                   R                  S   -
  -  nXðR                   R                  S   U R                   R                  S   -
  -  n[        UU5      nUS:X  a  SU-  nU R                  UUU5        g)z¯
Zoom in or out of the bounding box.

Will center the view in the center of the bounding box, and zoom by
the ratio of the size of the bounding box to the size of the Axes3D.
r   r   r   r   r²   NÚout)ÚbboxÚminr¼   r·   Úclipr  r™  rš  r›  rz  Ú_zoom_data_limits)re   rÀ  Ú	directionÚmodeÚtwinxÚtwinyÚstart_xÚstart_yÚstop_xÚstop_yÚzoom_center_xÚzoom_center_yÚax_center_xÚax_center_yrl  rm  Úscale_uÚscale_vrÈ   s                      rm   Ú_set_view_from_bboxÚAxes3D._set_view_from_bbox   s  € ð .2Ñ*ˆ˜6Ø�3‹;Ø—i‘i—m‘m AÑ&ˆGØ—Y‘Y—]‘] 1Ñ%‰FØ�S‹[Ø—i‘i—m‘m AÑ&ˆGØ—Y‘Y—]‘] 1Ñ%ˆFô Ÿ'š'¤&¨'Ð):Ó";Ø"&§)¡)§-¡-°Ñ"2°D·I±I·M±MÀ!Ñ4DóF‰ˆäŸ'š'¤&¨'Ð):Ó";Ø"&§)¡)§-¡-°Ñ"2°D·I±I·M±MÀ!Ñ4DóF‰ˆð !Ñ)¨1Ñ,ˆØ Ñ)¨1Ñ,ˆà—y‘y—}‘} QÑ'¨$¯)©)¯-©-¸Ñ*:Ñ:¸AÑ=ˆØ—y‘y—}‘} QÑ'¨$¯)©)¯-©-¸Ñ*:Ñ:¸AÑ=ˆà�‰�}°QÔ7Ø�‰�a˜˜{Ô8Ø�‰Œô �Ñ!Ó"ˆÜ�Ñ!Ó"ˆØŸ	™	Ÿ™ aÑ(¨4¯9©9¯=©=¸Ñ+;Ñ;Ñ<ˆØŸ	™	Ÿ™ aÑ(¨4¯9©9¯=©=¸Ñ+;Ñ;Ñ<ˆô �G˜WÓ%ˆð ˜ÓØ˜‘IˆEà×Ñ˜u e¨UÕ3ro   c                 ó^  • [         R                  " XU/5      n[         R                  " XA5      (       dÞ  [         R                  " U R                  U R                  U R
                  /5      nU[         R                  " S5      -  n[         R                  R                  UR                  U-  SS9nU R                  S;   aS  U R                  U R                  5      n[         R                  " [         R                  " XG   S-
  5      5      nXG   U   XG'   U R                  US   US   US   5        g)ar  
Zoom in or out of a 3D plot.

Will scale the data limits by the scale factors. These will be
transformed to the x, y, z data axes based on the current view angles.
A scale factor > 1 zooms out and a scale factor < 1 zooms in.

For an Axes that has had its aspect ratio set to 'equal', 'equalxy',
'equalyz', or 'equalxz', the relevant axes are constrained to zoom
equally.

Parameters
----------
scale_u : float
    Scale factor for the u view axis (view screen horizontal).
scale_v : float
    Scale factor for the v view axis (view screen vertical).
scale_w : float
    Scale factor for the w view axis (view screen depth).
rØ   r   r­   r¬   r   r²   N)r·   r¸   Úallcloserì  rí  rî  rû  rÃ   rÄ   r°  rµ   r¶   ry  rz  rœ  )	re   rÐ  rÑ  Úscale_wrÈ   rô  ÚSÚax_idxsÚmin_ax_idxss	            rm   rÃ  ÚAxes3D._zoom_data_limitsÐ  sæ   € ô* —’˜'¨GÐ4Ó5ˆô �{Š{˜5×*Ñ*ä—’˜$Ÿ,™,¨¯©°d·l±lÐCÓDˆAØœŸš˜q›	Ñ!ˆAÜ—I‘I—N‘N 1§3¡3¨¡7°�NÐ3ˆEð �|‰|ÐIÓIØ×9Ñ9¸$¿,¹,ÓG�Ü Ÿiši¬¯ª¨u©~ÀÑ/AÓ(BÓC�Ø!&¡°Ñ!<�‘à×Ñ  a¡¨%°©(°E¸!±HÕ=ro   c                 óò   • U R                  5       u  pEpgp‰U R                  XGU-  S-  -
  XGU-  S-  -   SS9  U R                  XXU-  S-  -
  XXU-  S-  -   SS9  U R                  XiU-  S-  -
  XiU-  S-  -   SS9  g)aT  
Keeping the center of the x, y, and z data axes fixed, scale their
limits by scale factors. A scale factor > 1 zooms out and a scale
factor < 1 zooms in.

Parameters
----------
scale_x : float
    Scale factor for the x data axis.
scale_y : float
    Scale factor for the y data axis.
scale_z : float
    Scale factor for the z data axis.
r²   Nr­  )rh  r¿   rÀ   rÁ   )
re   Úscale_xÚscale_yÚscale_zri  rj  rk  rl  rm  rn  s
             rm   rœ  ÚAxes3D._scale_axis_limitsö  s“   € ð  "&×!;Ñ!;Ó!=Ñˆ�˜ð 	�‰˜ ™Z¨™\Ñ)¨2°7±
¸1±Ñ+<À4ˆÑHØ�‰˜ ™Z¨™\Ñ)¨2°7±
¸1±Ñ+<À4ˆÑHØ�‰˜ ™Z¨™\Ñ)¨2°7±
¸1±Ñ+<À4ˆÒHro   c                 óv   • U R                  5       u  pp4pVX!-   S-  nXC-   S-  nXe-   S-  n	X!-
  n
XC-
  nXe-
  nXxXšX¼4$ )z%Get 3D world centers and axis ranges.r²   )r"  )re   r˜   r™   rš   r›   rœ   r�   ri  rj  rk  rl  rm  rn  s                rm   rh  ÚAxes3D._get_w_centers_ranges  s\   € ð .2¯_©_Ó->Ñ*ˆ�D Ø‰k˜1‰_ˆØ‰k˜1‰_ˆØ‰k˜1‰_ˆð ‰kˆØ‰kˆØ‰kˆØ�r˜rÐ%Ð%ro   c                 ób   • Ub  X0R                   l        U R                   R                  " X40 UD6$ )z9
Set zlabel.  See doc for `.set_ylabel` for description.
)rz   ÚlabelpadÚset_label_text)re   ÚzlabelÚfontdictrã  ri   s        rm   Ú
set_zlabelÚAxes3D.set_zlabel  s.   € ð ÑØ"*�J‰JÔØ�z‰z×(Ò(¨ÑD¸VÑDÐDro   c                 óN   • U R                   R                  nUR                  5       $ )z
Get the z-label text string.
)rz   ÚlabelÚget_text)re   rê  s     rm   Ú
get_zlabelÚAxes3D.get_zlabel#  s    € ð —
‘
× Ñ ˆØ�~‰~ÓÐro   c                 óB   • [        U5      (       a  SnXl        SU l        g)z®
Set / unset 3D grid.

.. note::

    Currently, this function does not behave the same as
    `.axes.Axes.grid`, but it is intended to eventually support that
    behavior.
TN)r>  Ú
_draw_gridrs   )re   Úvisibleri   s      rm   r%  ÚAxes3D.grid1  s   € ô ˆv�;‰;ØˆGØ!ŒØˆ�
ro   c                 óN  >• [         R                  " / SQUS9  US;   a  [        TU ]  " U40 UD6  US;   ap  [	        U5      nUR                  SS5        UR                  SS5        UR                  SS5        UR                  S	S5        U R                  R                  " S
0 UD6  gg)a  
Convenience method for changing the appearance of ticks and
tick labels.

See `.Axes.tick_params` for full documentation.  Because this function
applies to 3D Axes, *axis* can also be set to 'z', and setting *axis*
to 'both' autoscales all three axes.

Also, because of how Axes3D objects are drawn very differently
from regular 2D Axes, some of these settings may have
ambiguous meaning.  For simplicity, the 'z' axis will
accept settings as if it was like the 'y' axis.

.. note::
   Axes3D currently ignores some of these settings.
)r   r   r   rG  r­   )r   r   rG  rH  r­  Nr¬  ÚlabeltopÚlabelbottomrÓ   )r   r³   rJ   Útick_paramsÚdictrH   rz   Úset_tick_params)re   r®   ri   Úzkwrl   s       €rm   rõ  ÚAxes3D.tick_paramsA  s”   ø€ ô" 	×ÒÒ2¸Ò>ØÐ%Ó%Ü‰GÒ Ñ/¨Ò/Ø�=Ó Ü�v“,ˆCØ�G‰G�E˜4Ô Ø�G‰G�H˜dÔ#Ø�G‰G�J Ô%Ø�G‰G�M 4Ô(Ø�J‰J×&Ò&Ñ-¨Ó-ð !ro   c                 óH   • U R                  5       u  pU R                  X!SS9  g)z`
Invert the z-axis.

See Also
--------
zaxis_inverted
get_zlim, set_zlim
get_zbound, set_zbound
Nr­  )r½  r”  )re   r¬  r­  s      rm   Úinvert_zaxisÚAxes3D.invert_zaxis_  s!   € ð —m‘m“o‰ˆØ�‰�c¨ˆÒ-ro   Úget_invertedc                 ó<   • U R                  5       u  pX:  a  X4$ X!4$ )zŽ
Return the lower and upper z-axis bounds, in increasing order.

See Also
--------
set_zbound
get_zlim, set_zlim
invert_zaxis, zaxis_inverted
)r½  )re   r€  r�  s      rm   r“  ÚAxes3D.get_zboundn  s&   € ð —}‘}“‰ˆØ‹=Ø�<Ðà�<Ðro   )Ú
axlim_clipc                óZ   >• [         T	U ]  " XU40 UD6n[        R                  " XƒXV5        U$ )a\  
Add the text *s* to the 3D Axes at location *x*, *y*, *z* in data coordinates.

Parameters
----------
x, y, z : float
    The position to place the text.
s : str
    The text.
zdir : {'x', 'y', 'z', 3-tuple}, optional
    The direction to be used as the z-direction. Default: 'z'.
    See `.get_dir_vector` for a description of the values.
axlim_clip : bool, default: False
    Whether to hide text that is outside the axes view limits.

    .. versionadded:: 3.10
**kwargs
    Other arguments are forwarded to `matplotlib.axes.Axes.text`.

Returns
-------
`.Text3D`
    The created `.Text3D` instance.
)rJ   Útextr   Útext_2d_to_3d)
re   r   r   r   r„  Úzdirr   ri   r  rl   s
            €rm   r  ÚAxes3D.text~  s/   ø€ ô2 ‰wŠ|˜A !Ñ. vÑ.ˆÜ×Ò˜D TÔ6Øˆro   )r  r   c                ó¤  >• U R                  5       nU(       a-  [        US   [        5      (       d  Utp…SU;   a  [        S5      eOUR	                  SS5      n[
        R                  " XU5      u  pn[        TU ]   " X/UQ70 UD6n	U	 H  n
[        R                  " X¨X4S9  M     [        R                  " XXƒ5      u  pnU R                  XX‡5        U	$ )a#  
Plot 2D or 3D data.

Parameters
----------
xs : 1D array-like
    x coordinates of vertices.
ys : 1D array-like
    y coordinates of vertices.
zs : float or 1D array-like
    z coordinates of vertices; either one for all points or one for
    each point.
zdir : {'x', 'y', 'z'}, default: 'z'
    When plotting 2D data, the direction to use as z.
axlim_clip : bool, default: False
    Whether to hide data that is outside the axes view limits.

    .. versionadded:: 3.10
**kwargs
    Other arguments are forwarded to `matplotlib.axes.Axes.plot`.
r   re  z,plot() for multiple values for argument 'zs'©re  r  r   )Úhas_datarü   Ústrr=  rH   r   Ú_broadcast_with_masksrJ   Úplotr   Úline_2d_to_3dÚjuggle_axesr]  )re   rc  rd  r  r   rh   ri   r\  re  ÚlinesÚlinerl   s              €rm   r  ÚAxes3D.plotž  sË   ø€ ð, —=‘=“?ˆö
 œ
 4¨¡7¬C×0Ñ0ØˆIˆBØ�v‹~ÜÐ NÓOÐOð ð —‘˜D !Ó$ˆBä×0Ò0°¸Ó<‰
ˆ�ä‘’˜RÐ5 dÒ5¨fÑ5ˆÛˆDÜ×Ò °$ÔNñ ô ×&Ò& r¨rÓ8‰
ˆ�Ø×Ñ˜B BÔ1Øˆro   r¢   )ÚwhererÅ  Ú
facecolorsÚshader   c          	      óÖ  • [         R                  " / SQUS9  U R                  5       n[        R                  " XX4XV5      u  pp4pVU	c  U R
                  R                  5       /n	[        [        R                  " U	5      5      n	Uc  SnOY[        R                  " U[        S9nUR                  UR                  :w  a&  [        SUR                   SUR                   S35      eU[        R                  " U5      ) -  nUS	:X  ao  [         R"                  " [        R$                  " X   XG   45      [        R$                  " X'   XW   45      [        R$                  " X7   Xg   45      S
S9(       a  SnOSnU
c  US:X  a  Sn
OSn
/ n[        R&                  " U5       GH�  u  nnXU nX/U nX?U nXOU nX_U nXoU n[)        U5      (       d  M1  US:X  aá  [)        U5      S-
  n[        R*                  " USS45      n[        R,                  " USS USS USS 45      USS2SSS24'   [        R,                  " USS USS USS 45      USS2SSS24'   [        R,                  " USS USS USS 45      USS2SSS24'   [        R,                  " USS USS USS 45      USS2SSS24'   U/ UQ-   nGM  US:X  d  GM!  [        R,                  " UUU45      n[        R,                  " USSS2   USSS2   USSS2   45      n[        R$                  " UU4SS9nUR/                  U5        GM�     [         R0                  " U4XšUS.UD6nU R3                  U5        U R5                  X/X%/X6/U5        U$ )aC  
Fill the area between two 3D curves.

The curves are defined by the points (*x1*, *y1*, *z1*) and
(*x2*, *y2*, *z2*). This creates one or multiple quadrangle
polygons that are filled. All points must be the same length N, or a
single value to be used for all points.

Parameters
----------
x1, y1, z1 : float or 1D array-like
    x, y, and z  coordinates of vertices for 1st line.

x2, y2, z2 : float or 1D array-like
    x, y, and z coordinates of vertices for 2nd line.

where : array of bool (length N), optional
    Define *where* to exclude some regions from being filled. The
    filled regions are defined by the coordinates ``pts[where]``,
    for all x, y, and z pts. More precisely, fill between ``pts[i]``
    and ``pts[i+1]`` if ``where[i] and where[i+1]``. Note that this
    definition implies that an isolated *True* value between two
    *False* values in *where* will not result in filling. Both sides of
    the *True* position remain unfilled due to the adjacent *False*
    values.

mode : {'quad', 'polygon', 'auto'}, default: 'auto'
    The fill mode. One of:

    - 'quad':  A separate quadrilateral polygon is created for each
      pair of subsequent points in the two lines.
    - 'polygon': The two lines are connected to form a single polygon.
      This is faster and can render more cleanly for simple shapes
      (e.g. for filling between two lines that lie within a plane).
    - 'auto': If the points all lie on the same 3D plane, 'polygon' is
      used. Otherwise, 'quad' is used.

facecolors : list of :mpltype:`color`, default: None
    Colors of each individual patch, or a single color to be used for
    all patches.

shade : bool, default: None
    Whether to shade the facecolors. If *None*, then defaults to *True*
    for 'quad' mode and *False* for 'polygon' mode.

axlim_clip : bool, default: False
    Whether to hide data that is outside the axes view limits.

    .. versionadded:: 3.10

**kwargs
    All other keyword arguments are passed on to `.Poly3DCollection`.

Returns
-------
`.Poly3DCollection`
    A `.Poly3DCollection` containing the plotted polygons.

)r¢   ÚquadÚpolygon)rÅ  NTrÙ   zwhere size (z) does not match size (Ú)r¢   gê-�™—q=)Úatolr  r  Fr   r×   rØ   râ  r   r²   r­   )r  r  r   )r   r³   r  r   r
  Ú_get_patches_for_fillÚget_next_colorÚlistÚmcolorsÚto_rgba_arrayr·   rÞ   re  ÚsizerÝ   Úisnanr   Ú_all_points_on_planeÚconcatenateÚcontiguous_regionsr>  ÚemptyrU  rv  ÚPoly3DCollectionÚadd_collectionr]  )re   rm  rq  rt  Úx2Úy2Úz2r  rÅ  r  r  r   ri   r\  ÚpolysÚidx0Úidx1Úx1iÚy1iÚz1iÚx2iÚy2iÚz2iÚ	n_polys_iÚpolys_iÚline1Úline2ÚpolyÚpolycs                                rm   Úfill_betweenÚAxes3D.fill_betweenÌ  sn  € ô| 	×ÒÒ6¸TÒBà—=‘=“?ˆÜ!&×!<Ò!<¸RÀRÈRÓ!TÑˆ�˜àÑØ×4Ñ4×CÑCÓEÐFˆJÜœ'×/Ò/°
Ó;Ó<ˆ
à‰=Ø‰Eä—J’J˜u¬DÑ1ˆEØ�z‰z˜RŸW™WÓ$Ü  <°·
±
¨|ð <*Ø*,¯'©'¨°!ð"5ó 6ð 6àœŸš "›˜Ñ%ˆà�6‹>Ü×)Ò)¬"¯.ª.¸"¹)ÀRÁYÐ9OÓ*PÜ*,¯.ª.¸"¹)ÀRÁYÐ9OÓ*PÜ*,¯.ª.¸"¹)ÀRÁYÐ9OÓ*PØ/4÷6ð !‘à�à‰=Ø�v‹~Ø‘à�àˆÜ×2Ò2°5×9‰JˆD�$Ø˜$�-ˆCØ˜$�-ˆCØ˜$�-ˆCØ˜$�-ˆCØ˜$�-ˆCØ˜$�-ˆCä�s—8‘8Ùà�v‹~ä ›H q™L�	ÜŸ(š( I¨q°!Ð#4Ó5�Ü#%§?¢?°C¸¸°H¸cÀ#À2¸hÈÈCÈRÈÐ3QÓ#R�š˜1ša˜Ñ Ü#%§?¢?°C¸¸°G¸SÀÀ¸WÀcÈ!È"ÀgÐ3NÓ#O�š˜1ša˜Ñ Ü#%§?¢?°C¸¸°G¸SÀÀ¸WÀcÈ!È"ÀgÐ3NÓ#O�š˜1ša˜Ñ Ü#%§?¢?°C¸¸°H¸cÀ#À2¸hÈÈCÈRÈÐ3QÓ#R�š˜1ša˜Ñ Ø 
 ' 
Ñ*“Ø˜Ö"ÜŸš¨¨c°3¨Ó8�ÜŸš¨©T¨r¨T©°C¹¸"¸±I¸sÁ4ÀRÀ4¹yÐ(IÓJ�Ü—~’~ u¨e n¸1Ñ=�Ø—‘˜T×"ñ1 :ô4 ×&Ò& uð H¸Ø2<ñHØ@FñHˆà×Ñ˜EÔ"à×Ñ˜R˜H r h°°¸(ÔCØˆro   )rÄ   ÚvminÚvmaxÚlightsourcer   c                ó  • U R                  5       n
UR                  S:w  a  [        S5      e[        R                  " U5      n[
        R                  " XU5      u  pnUR                  u  p¼SU	;   =(       d    SU	;   nSU	;   =(       d    SU	;   nU(       a  U(       a  [        S5      eU	R                  SS5      nU	R                  SS5      nU	R                  SS	5      nU	R                  SS	5      n[        R                  S
   (       a  UnOU(       + nU(       aX  [        [        [
        R                  " UU-  5      S5      5      n[        [        [
        R                  " UU-  5      S5      5      nU	R                  SS5      nU	R                  SS5      nU	R                  SUSL 5      nUc  [        S5      e/ nUS-
  U-  S:X  aO  US-
  U-  S:X  aC  Uc@  [
        R                  " XU4 Vs/ s H  n[        R                   " UUU5      PM     snSS9nGO[#        [%        SUS-
  U5      5      US-
  /-   n[#        [%        SUS-
  U5      5      US-
  /-   n/ n[&        R(                  " U5       Hª  u  nn[&        R(                  " U5       HŠ  u  nnXU4 Vs/ s H(  n[        R*                  " UUUS-   2UUS-   24   5      PM*     n n[
        R,                  " U 5      R.                  n UR1                  U 5        Uc  Ms  UR1                  UU   U   5        MŒ     M¬     [3        U[
        R4                  5      (       a)  [
        R6                  " U5      R9                  5       (       dš  / n!/ n"[&        R:                  " UU5       Ht  u  n#n$[
        R,                  " U#5      [
        R6                  " U#5      R9                  SS9   n%[=        U%5      (       d  MR  U!R1                  U%5        U"R1                  U$5        Mv     U!nUb  U"nUb  [>        R@                  " U4UUUXxS.U	D6n&GO@U(       aÄ  [>        R@                  " U4SU0U	D6n&[3        U[
        R4                  5      (       a  US   RC                  SS9n'O<[
        R,                  " U V s/ s H  n U SS2S4   RC                  5       PM     sn 5      n'U&RE                  U'5        Uc  Ub  U&RG                  XV5        Ub  U&RI                  U5        OuU	R                  SS5      n(U(c  U RJ                  RM                  5       n([
        R,                  " [N        RP                  " U(5      5      n([>        R@                  " U4U(UUUS.U	D6n&U RS                  U&5        U RU                  XX:5        U&$ s  snf s  snf s  sn f )a„  
Create a surface plot.

By default, it will be colored in shades of a solid color, but it also
supports colormapping by supplying the *cmap* argument.

.. note::

   The *rcount* and *ccount* kwargs, which both default to 50,
   determine the maximum number of samples used in each direction.  If
   the input data is larger, it will be downsampled (by slicing) to
   these numbers of points.

.. note::

   To maximize rendering speed consider setting *rstride* and *cstride*
   to divisors of the number of rows minus 1 and columns minus 1
   respectively. For example, given 51 rows rstride can be any of the
   divisors of 50.

   Similarly, a setting of *rstride* and *cstride* equal to 1 (or
   *rcount* and *ccount* equal the number of rows and columns) can use
   the optimized path.

Parameters
----------
X, Y, Z : 2D arrays
    Data values.

rcount, ccount : int
    Maximum number of samples used in each direction.  If the input
    data is larger, it will be downsampled (by slicing) to these
    numbers of points.  Defaults to 50.

rstride, cstride : int
    Downsampling stride in each direction.  These arguments are
    mutually exclusive with *rcount* and *ccount*.  If only one of
    *rstride* or *cstride* is set, the other defaults to 10.

    'classic' mode uses a default of ``rstride = cstride = 10`` instead
    of the new default of ``rcount = ccount = 50``.

color : :mpltype:`color`
    Color of the surface patches.

cmap : Colormap, optional
    Colormap of the surface patches.

facecolors : list of :mpltype:`color`
    Colors of each individual patch.

norm : `~matplotlib.colors.Normalize`, optional
    Normalization for the colormap.

vmin, vmax : float, optional
    Bounds for the normalization.

shade : bool, default: True
    Whether to shade the facecolors.  Shading is always disabled when
    *cmap* is specified.

lightsource : `~matplotlib.colors.LightSource`, optional
    The lightsource to use when *shade* is True.

axlim_clip : bool, default: False
    Whether to hide patches with a vertex outside the axes view limits.

    .. versionadded:: 3.10

**kwargs
    Other keyword arguments are forwarded to `.Poly3DCollection`.
r²   ú!Argument Z must be 2-dimensional.ÚrstrideÚcstrideÚrcountÚccountú.Cannot specify both stride and count argumentsrÎ  é2   ú_internal.classic_moder   r  NÚcmapr  zshade cannot be None.r   râ  r­   )Ú
edgecolorsr  r  r<  r   r   ).r²   Úcolor)r  r  r<  r   )+r  ÚndimrÝ   r   Ú_to_unmasked_float_arrayr·   Úbroadcast_arraysrS  rH   rž  rŸ  Úintr¼   ÚceilÚgetÚstackÚ_array_patch_perimetersr  rx  Ú	itertoolsÚpairwiseÚ_array_perimeterr¸   r°  rv  rü   ÚndarrayÚisfiniteÚallÚzip_longestr>  r   r$  r»   Ú	set_arrayÚset_climÚset_normÚ
_get_linesr  r  Úto_rgbar%  r]  ))re   rY  rZ  r[  rÄ   r:  r;  r<  r   ri   r\  ÚrowsÚcolsÚ
has_strideÚ	has_countr?  r@  rA  rB  Úcompute_stridesÚfcolorsrF  r  Úcolsetrˆ  r)  Úrow_indsÚcol_indsÚrsÚrs_nextÚcsÚcs_nextrú  Ú	new_polysÚ
new_colsetrŠ  ÚcolÚnew_polyr7  Úavg_zrH  s)                                            rm   Úplot_surfaceÚAxes3D.plot_surfaceM  s  € ðV —=‘=“?ˆà�6‰6�Q‹;ÜÐ@ÓAÐAä×*Ò*¨1Ó-ˆÜ×%Ò% a¨AÓ.‰ˆˆaØ—W‘W‰
ˆà &Ñ(×?¨I¸Ñ,?ˆ
Ø Ñ&×<¨(°fÑ*<ˆ	æž)ÜÐMÓNÐNà—*‘*˜Y¨Ó+ˆØ—*‘*˜Y¨Ó+ˆØ—‘˜H bÓ)ˆØ—‘˜H bÓ)ˆä�<‰<Ð0×1ð (‰Oð #-œnˆOæÜœ#œbŸgšg d¨V¡mÓ4°aÓ8Ó9ˆGÜœ#œbŸgšg d¨V¡mÓ4°aÓ8Ó9ˆGà—*‘*˜\¨4Ó0ˆà�z‰z˜& $Ó'ˆØ—
‘
˜7 D¨D LÓ1ˆØ‰=ÜÐ4Ó5Ð5àˆØ�1‰H˜Ñ 1Ó$Ø�1‰H˜Ñ 1Ó$Ø‰?Ü—H’Hà ™)ó%Ú#�Qô ×.Ò.¨q°'¸7ÖCÙ#ñ%àñŠEô œE ! T¨!¡V¨WÓ5Ó6¸$¸q¹&¸ÑAˆHÜœE ! T¨!¡V¨WÓ5Ó6¸$¸q¹&¸ÑAˆHàˆEÜ(×1Ò1°(Ö;‘��GÜ#,×#5Ò#5°hÖ#?‘K�B˜ð #$¨¡óò "+˜Aô ×.Ò.¨q°°G¸A±I°¸rÀ'È!Á)¸|Ð1KÑ/LÖMÙ!*ð ð ô Ÿš "›Ÿ™�BØ—L‘L Ô$àÓ*ØŸ™ g¨b¡k°"¡oÖ6ó $@ñ  <ô" ˜%¤§¡×,Ñ,´B·K²KÀÓ4F×4JÑ4J×4LÑ4LØˆIØˆJô
 $×/Ò/°°vÖ>‘��3ÜŸ8š8 A›;¤r§{¢{°1£~×'9Ñ'9¸qÐ'9Ð'AÑB�Ü�x—=“=Ø×$Ñ$ XÔ.Ø×%Ñ% cÖ*ñ	 ?ð ˆEØÑ"Ø#�ð
 ÑÜ×*Ò*ØðJØ"(°VÀ5Ø'ñJàBHñJŠEö Ü×*Ò*¨5ÑR¸ZÐRÈ6ÑRˆEä˜%¤§¡×,Ñ,Ø˜f™×*Ñ*°Ð*Ð3‘äŸš¹EÓ!BºE°b "¢Q¨ T¡(§-¡-¦/¹EÑ!BÓC�Ø�O‰O˜EÔ"ØÑ 4Ñ#3Ø—‘˜tÔ*ØÑØ—‘˜tÔ$øà—J‘J˜w¨Ó-ˆEØ‰}ØŸ™×6Ñ6Ó8�Ü—H’HœWŸ_š_¨UÓ3Ó4ˆEä×*Ò*Øð1Ø"'¨uÀ+Ø%ñ1à)/ñ1ˆEð 	×Ñ˜EÔ"Ø×Ñ˜A !Ô.àˆùòY%ùòùò\ "Cs   Ç'"U?Ê/VÒ !V	c                ó  • U R                  5       nUR                  S:w  a  [        S5      e[        R                  " XU5      u  pnUR
                  u  pxSU;   =(       d    SU;   n	SU;   =(       d    SU;   n
U	(       a  U
(       a  [        S5      eUR                  SS5      nUR                  SS5      nUR                  SS	5      nUR                  SS	5      n[        R                  S
   (       ap  U
(       ah  U(       a+  [        [        [        R                  " X}-  5      S5      5      OSnU(       a+  [        [        [        R                  " XŽ-  5      S5      5      OSnOoU	(       dh  U(       a+  [        [        [        R                  " X}-  5      S5      5      OSnU(       a+  [        [        [        R                  " XŽ-  5      S5      5      OSn[        R                  " U5      [        R                  " U5      [        R                  " U5      nnnU(       a1  [        [        SX{5      5      nUS:”  a  US   US-
  :w  a	  UUS-
  /-  nO/ nU(       a1  [        [        SXŒ5      5      nUS:”  a  US   US-
  :w  a	  UUS-
  /-  nO/ nUS:X  a  US:X  a  [        S5      eUR                  S:X  a  / n/ nU Vs/ s H  nUU   PM
     nnU Vs/ s H  nUU   PM
     nnU Vs/ s H  nUU   PM
     nnU Vs/ s H  nUU   PM
     nnU Vs/ s H  nUU   PM
     nnU Vs/ s H  nUU   PM
     nn[!        UUU5       VVVs/ s H  u  nnn[        [!        UUU5      5      PM     snnn[!        UUU5       VVVs/ s H  u  nnn[        [!        UUU5      5      PM     snnn-   n["        R$                  " U4SU0UD6nU R'                  U5        U R)                  XX65        U$ s  snf s  snf s  snf s  snf s  snf s  snf s  snnnf s  snnnf )at  
Plot a 3D wireframe.

.. note::

   The *rcount* and *ccount* kwargs, which both default to 50,
   determine the maximum number of samples used in each direction.  If
   the input data is larger, it will be downsampled (by slicing) to
   these numbers of points.

Parameters
----------
X, Y, Z : 2D arrays
    Data values.

axlim_clip : bool, default: False
    Whether to hide lines and patches with vertices outside the axes
    view limits.

    .. versionadded:: 3.10

rcount, ccount : int
    Maximum number of samples used in each direction.  If the input
    data is larger, it will be downsampled (by slicing) to these
    numbers of points.  Setting a count to zero causes the data to be
    not sampled in the corresponding direction, producing a 3D line
    plot rather than a wireframe plot.  Defaults to 50.

rstride, cstride : int
    Downsampling stride in each direction.  These arguments are
    mutually exclusive with *rcount* and *ccount*.  If only one of
    *rstride* or *cstride* is set, the other defaults to 1.  Setting a
    stride to zero causes the data to be not sampled in the
    corresponding direction, producing a 3D line plot rather than a
    wireframe plot.

    'classic' mode uses a default of ``rstride = cstride = 1`` instead
    of the new default of ``rcount = ccount = 50``.

**kwargs
    Other keyword arguments are forwarded to `.Line3DCollection`.
r²   r>  r?  r@  rA  rB  rC  r   rD  rE  r   râ  z*Either rstride or cstride must be non zeror   )r  rI  rÝ   r·   rK  rS  rH   rž  rŸ  rL  r¼   rM  Ú	transposer  rx  r  Úzipr   ÚLine3DCollectionr%  r]  ) re   rY  rZ  r[  r   ri   r\  r]  r^  r_  r`  r?  r@  rA  rB  ÚtXÚtYÚtZÚriiÚciirÊ   ÚxlinesÚylinesÚzlinesÚtxlinesÚtylinesÚtzlinesÚxlÚylÚzlr  Úlinecs                                    rm   Úplot_wireframeÚAxes3D.plot_wireframe	  s›  € ðX —=‘=“?ˆØ�6‰6�Q‹;ÜÐ@ÓAÐAä×%Ò% a¨AÓ.‰ˆˆaØ—W‘W‰
ˆà &Ñ(×?¨I¸Ñ,?ˆ
Ø Ñ&×<¨(°fÑ*<ˆ	æž)ÜÐMÓNÐNà—*‘*˜Y¨Ó*ˆØ—*‘*˜Y¨Ó*ˆØ—‘˜H bÓ)ˆØ—‘˜H bÓ)ˆä�<‰<Ð0×1ö ÞAGœ#œc¤"§'¢'¨$©-Ó"8¸!Ó<Ô=ÈQ�ÞAGœ#œc¤"§'¢'¨$©-Ó"8¸!Ó<Ô=ÈQ�øö ÞAGœ#œc¤"§'¢'¨$©-Ó"8¸!Ó<Ô=ÈQ�ÞAGœ#œc¤"§'¢'¨$©-Ó"8¸!Ó<Ô=ÈQ�ô
 —\’\ !“_¤b§l¢l°1£o´r·|²|ÀA³�ˆBˆæÜ”u˜Q Ó.Ó/ˆCà�a‹x˜C ™G¨¨q©Ó1Ø˜˜Q™�x‘�øàˆCÞÜ”u˜Q Ó.Ó/ˆCà�a‹x˜C ™G¨¨q©Ó1Ø˜˜Q™�x‘�øàˆCà�a‹<˜G q›LÜÐIÓJÐJð �6‰6�Q‹;ØˆCØˆCá #Ó$¢˜1�!�A”$¡ˆÐ$Ù #Ó$¢˜1�!�A”$¡ˆÐ$Ù #Ó$¢˜1�!�A”$¡ˆÐ$á"%Ó&¢#˜Q�2�a”5¡#ˆÐ&Ù"%Ó&¢#˜Q�2�a”5¡#ˆÐ&Ù"%Ó&¢#˜Q�2�a”5¡#ˆÐ&ô $' v¨v°vÔ#>õ@Ú#>‘Z�R˜˜Rô ”s˜2˜r 2“Ö'Ù#>ó@ô $' w°¸Ô#AõCÚ#A‘Z�R˜˜Rô œ˜R  R›Ö)Ù#AóCñCˆô
 ×&Ò& uÑN¸ÐNÀvÑNˆØ×Ñ˜EÔ"Ø×Ñ˜A !Ô.àˆùò# %ùÚ$ùÚ$ùâ&ùÚ&ùÚ&ùô@ùôCs0   Ê3O ËO%ËO*Ë2O/ÌO4ÌO9Ì>$O>Í7$P
)rH  rÄ   r:  r;  r<  r   c                óÚ  • U R                  5       n	Uc  U R                  R                  5       n[        R                  " [
        R                  " U5      5      nUR                  SS5      n
UR                  SU
SL 5      n[        R                  " U0 UD6u  pÇn UR                  S5      n[        R                  " U5      nUR                  5       nUR                  U   nUR                  U   nXÞ   n[        R                   " UUU4SS9nU
(       ar  ["        R$                  " U/UQ7SU0UD6nUSS2SS2S4   R'                  S	S9nUR)                  U5        Uc  Ub  UR+                  X45        Ub  UR-                  U5        O["        R$                  " U/UQ7XµXS
.UD6nU R/                  U5        U R1                  UR                  UR                  XÙ5        U$ ! [         a    Utp× GN@f = f)aÏ  
Plot a triangulated surface.

The (optional) triangulation can be specified in one of two ways;
either::

  plot_trisurf(triangulation, ...)

where triangulation is a `~matplotlib.tri.Triangulation` object, or::

  plot_trisurf(X, Y, ...)
  plot_trisurf(X, Y, triangles, ...)
  plot_trisurf(X, Y, triangles=triangles, ...)

in which case a Triangulation object will be created.  See
`.Triangulation` for an explanation of these possibilities.

The remaining arguments are::

  plot_trisurf(..., Z)

where *Z* is the array of values to contour, one per point
in the triangulation.

Parameters
----------
X, Y, Z : array-like
    Data values as 1D arrays.
color
    Color of the surface patches.
cmap
    A colormap for the surface patches.
norm : `~matplotlib.colors.Normalize`, optional
    An instance of Normalize to map values to colors.
vmin, vmax : float, optional
    Minimum and maximum value to map.
shade : bool, default: True
    Whether to shade the facecolors.  Shading is always disabled when
    *cmap* is specified.
lightsource : `~matplotlib.colors.LightSource`, optional
    The lightsource to use when *shade* is True.
axlim_clip : bool, default: False
    Whether to hide patches with a vertex outside the axes view limits.

    .. versionadded:: 3.10
**kwargs
    All other keyword arguments are passed on to
    :class:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`

Examples
--------
.. plot:: gallery/mplot3d/trisurf3d.py
.. plot:: gallery/mplot3d/trisurf3d_2.py
NrF  r  r[  râ  r­   r   r²   r   )r  r<  r  r   )r  r[  r  r·   r¸   r  r\  rN  rH   r   Úget_from_args_and_kwargsÚKeyErrorrÞ   Úget_masked_trianglesr   r   rO  r   r$  r»   rX  rY  rZ  r%  r]  )re   rH  rÄ   r:  r;  r<  r   rh   ri   r\  rF  r  Útrir   Ú	trianglesÚxtÚytÚztÚvertsr7  rn  s                        rm   Úplot_trisurfÚAxes3D.plot_trisurf�	  sê  € ðr —=‘=“?ˆð ‰=Ø—O‘O×2Ñ2Ó4ˆEÜ—’œŸš¨Ó/Ó0ˆà�z‰z˜& $Ó'ˆØ—
‘
˜7 D¨D LÓ1ˆô ×2Ò2°DÐC¸FÑCñ 	ˆ�6ð	Ø—
‘
˜3“ˆAô �JŠJ�q‹Mˆà×,Ñ,Ó.ˆ	Ø�U‰U�9ÑˆØ�U‰U�9ÑˆØ‰\ˆÜ—’˜"˜b "˜¨BÑ/ˆæÜ×*Ò*¨5ð L°4ò LØ6@ðLØDJñLˆEð š!šQ ˜'‘N×'Ñ'¨QÐ'Ð/ˆEØ�O‰O˜EÔ"ØÑ 4Ñ#3Ø—‘˜tÔ*ØÑØ—‘˜tÔ$øä×*Ò*ØðCØñCØ$)Ø ñCà;AñCˆEð 	×Ñ˜EÔ"Ø×Ñ˜CŸE™E 3§5¡5¨!Ô6àˆøô; ó 	àˆHˆA’ð	ús   ÂG ÇG*Ç)G*é   c                 óð  • UR                   S   UR                   S   -
  S-  n/ n/ n[        UR                   5       GHh  u  pgUR                  5       U   n/ UR                  5       Qn	UR	                  5       U   n
[
        R                  " X—U-
  5      n[
        R                  " X—U-   5      n[        US   5      (       d  M…  [        [        [        US   5      U-  5      S5      n[        US   5      S-
  US-
  -  nUR                  [        [        U5      S-
  5       Vs/ s HU  nUS   [        Xþ-  5         US   [        US-   U-  5         US   [        US-   U-  5         US   [        Xþ-  5         4PMW     sn5        UR                  U
/[        U5      S-
  -  5        GMk     U R                  [
        R                  " [        R                  " U5      XUSS95        UR!                  5         gs  snf )z$
Extend a contour in 3D by creating
r   r   r²   T)r  rG  r  N)Úlevelsr¾   Ú	get_pathsÚ_iter_connected_componentsÚget_edgecolorr   Ú_paths_to_3d_segmentsr>  r¼   ÚroundÚextendrx  Úadd_collection3dr$  r·   r¸   Úremove)re   ÚcsetÚstridern  Ú	polyvertsÚcolorsrÔ  ÚlevelÚpathÚsubpathsrH  r­  ÚbotÚnstepsÚstepsizerÊ   s                   rm   Ú_3d_extend_contourÚAxes3D._3d_extend_contourö	  sÛ  € ð
 �k‰k˜!‰n˜tŸ{™{¨1™~Ñ-°Ñ2ˆØˆ	ØˆÜ# D§K¡K×0‰JˆCØ—>‘>Ó# CÑ(ˆDØ;˜×8Ñ8Ó:Ð;ˆHØ×&Ñ&Ó(¨Ñ-ˆEÜ×-Ò-¨hÀ¹
ÓCˆCÜ×-Ò-¨hÀ¹
ÓCˆCÜ�s˜1‘v—;‘;ÙÜœœs 3 q¡6›{¨VÑ3Ó4°aÓ8ˆFÜ˜C ™F› a™¨F°Q©JÑ7ˆHØ×Ñô œu V›}¨qÑ0Ô1ó3ò 2�Að �Q‘œ˜a™lÓ+Ñ,¨c°!©f´U¸AÀ¹EÀXÑ;MÓ5NÑ.OØ�Q‘œ˜q 1™u¨Ñ0Ó1Ñ2°C¸±F¼5ÀÁÓ;NÑ4OóQá1ñ3ô 4ð �M‰M˜5˜'¤U¨6£]°QÑ%6Ñ7×8ñ 1ð 	×Ñœe×4Ò4Ü�HŠH�YÓØ¸ñ>ô 	?ð 	�‰�ùò3s   Ä AG3
c                 óŠ   • SU-   nU(       a  U R                  X5        g [        R                  " Xb  UOUR                  UUS9  g )NrW  r  )r§  r   Úcollection_2d_to_3dr”  )re   r�  Úextend3drž  r  Úoffsetr   s          rm   Úadd_contour_setÚAxes3D.add_contour_set
  s?   € ð �T‰zˆÞØ×#Ñ# DÕ1ä×%Ò%ØÑ#5™¸4¿;¹;ÈTØ%ó'ro   c                ó&   • U R                  XUUS9  g )N©r  r¬  r   )Ú_add_contourf_set)re   r�  r  r¬  r   s        rm   Úadd_contourf_setÚAxes3D.add_contourf_set
  s   € Ø×Ñ˜t°vØ*4ð 	ò 	6ro   c                 ó$  • SU-   nUR                   SS [        R                  " UR                   5      S-  -   nUR                  (       aN  UR                   S   [        R                  " UR                   SS 5      S-  -
  n[        R                  " USU5      nUR
                  (       aL  UR                   S   [        R                  " UR                   SS 5      S-  -   n[        R                  " XW5      n[        R                  " Xb  UOUUUS9  U$ )z]
Returns
-------
levels : `numpy.ndarray`
    Levels at which the filled contours are added.
rW  Nrâ  r²   r   éþÿÿÿr  )	r”  r·   ÚdiffÚ_extend_minÚinsertÚ_extend_maxrv  r   rª  )re   r�  r  r¬  r   Ú	midpointsÚ	min_levelÚ	max_levels           rm   r±  ÚAxes3D._add_contourf_set!
  sà   € ð �T‰zˆà—K‘K  Ð$¤r§w¢w¨t¯{©{Ó';¸aÑ'?Ñ?ˆ	à××ØŸ™ A™¬¯ª°·±¸R¸a°Ó)AÀAÑ)EÑEˆIÜŸ	š	 )¨Q°	Ó:ˆIØ××ØŸ™ B™¬"¯'ª'°$·+±+¸b¸cÐ2BÓ*CÀaÑ*GÑGˆIÜŸ	š	 )Ó7ˆIä×!Ò!ØÑ1‘V°yÀtØ!ò	#ð Ðro   )r«  rž  r  r¬  r   c                óÐ   >• U R                  5       n[        R                  " XX65      u  pÍn[        TU ]  " XÍU/U	Q70 U
D6nU R                  XôXVXx5        U R                  XX;5        U$ )a  
Create a 3D contour plot.

Parameters
----------
X, Y, Z : array-like,
    Input data. See `.Axes.contour` for supported data shapes.
extend3d : bool, default: False
    Whether to extend contour in 3D.
stride : int, default: 5
    Step size for extending contour.
zdir : {'x', 'y', 'z'}, default: 'z'
    The direction to use.
offset : float, optional
    If specified, plot a projection of the contour lines at this
    position in a plane normal to *zdir*.
axlim_clip : bool, default: False
    Whether to hide lines with a vertex outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

*args, **kwargs
    Other arguments are forwarded to `matplotlib.axes.Axes.contour`.

Returns
-------
matplotlib.contour.QuadContourSet
)r  r   Úrotate_axesrJ   Úcontourr­  r]  )re   rY  rZ  r[  r«  rž  r  r¬  r   rh   ri   r\  ÚjXÚjYÚjZr�  rl   s                   €rm   rÀ  ÚAxes3D.contour8
  sh   ø€ ðD —=‘=“?ˆä×&Ò& q¨QÓ5‰
ˆ�Ü‰wŠ˜r rÐ;¨DÒ;°FÑ;ˆØ×Ñ˜T¨V¸6ÔNà×Ñ˜A !Ô.Øˆro   c                óª  >• U R                  5       n[        R                  " U0 UD6u  p–nU	R                  n
U	R                  nSU;   a  UR                  S5      nOUtpÆ[        R                  " X«XÃ5      u  pÞn[        XÞU	R                  U	R                  5      n	[        TU ],  " XŸ/UQ70 UD6nU R                  UXX4U5        U R                  X«XÈ5        U$ )a£  
Create a 3D contour plot.

.. note::
    This method currently produces incorrect output due to a
    longstanding bug in 3D PolyCollection rendering.

Parameters
----------
X, Y, Z : array-like
    Input data. See `.Axes.tricontour` for supported data shapes.
extend3d : bool, default: False
    Whether to extend contour in 3D.
stride : int, default: 5
    Step size for extending contour.
zdir : {'x', 'y', 'z'}, default: 'z'
    The direction to use.
offset : float, optional
    If specified, plot a projection of the contour lines at this
    position in a plane normal to *zdir*.
axlim_clip : bool, default: False
    Whether to hide lines with a vertex outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
*args, **kwargs
    Other arguments are forwarded to `matplotlib.axes.Axes.tricontour`.

Returns
-------
matplotlib.tri._tricontour.TriContourSet
r[  )r  r   r‡  r   r   rH   r   r¿  r‹  ÚmaskrJ   Ú
tricontourr­  r]  )re   r«  rž  r  r¬  r   rh   ri   r\  rŠ  rY  rZ  r[  rÁ  rÂ  rÃ  r�  rl   s                    €rm   rÇ  ÚAxes3D.tricontoure
  sÎ   ø€ ðJ —=‘=“?ˆä)×BÒBØð!Øñ!Ñˆ�6à�E‰EˆØ�E‰EˆØ�&‹=Ø—
‘
˜3“‰Að ˆHˆAä×&Ò& q¨QÓ5‰
ˆ�Ü˜B C§M¡M°3·8±8Ó<ˆä‰wÒ! #Ð;¨DÒ;°FÑ;ˆØ×Ñ˜T 8°TÀ:ÔNà×Ñ˜A !Ô.Øˆro   c                 óÈ   • SUSUSX4U0nS Vs/ s H3  n[         R                  " Xx   5      [         R                  " Xx   5      4PM5     n	nU R                  " / U	QUP76   g s  snf )Nr   r   r   r   )r·   ÚnanminÚnanmaxr]  )
re   rY  rZ  r[  r  r”  r\  Údim_valsÚdimÚlimitss
             rm   Ú_auto_scale_contourfÚAxes3D._auto_scale_contourfŸ
  sp   € ð ˜˜C  C¨°&Ð9ˆñ -ó.Ú,�cô —9’9˜X™]Ó+¬R¯YªY°x±}Ó-EÓFÙ,ð 	ð .à×ÒÐ.˜VÐ. XÔ.ùò.s   Ž:Ar°  c                óÐ   >• U R                  5       n	[        R                  " XX45      u  p«n[        TU ]  " X«U/UQ70 UD6nU R                  XÔXV5      nU R                  XX4Xé5        U$ )aŸ  
Create a 3D filled contour plot.

Parameters
----------
X, Y, Z : array-like
    Input data. See `.Axes.contourf` for supported data shapes.
zdir : {'x', 'y', 'z'}, default: 'z'
    The direction to use.
offset : float, optional
    If specified, plot a projection of the contour lines at this
    position in a plane normal to *zdir*.
axlim_clip : bool, default: False
    Whether to hide lines with a vertex outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
*args, **kwargs
    Other arguments are forwarded to `matplotlib.axes.Axes.contourf`.

Returns
-------
matplotlib.contour.QuadContourSet
)r  r   r¿  rJ   Úcontourfr±  rÏ  )re   rY  rZ  r[  r  r¬  r   rh   ri   r\  rÁ  rÂ  rÃ  r�  r”  rl   s                  €rm   rÒ  ÚAxes3D.contourf©
  sj   ø€ ð8 —=‘=“?ˆä×&Ò& q¨QÓ5‰
ˆ�Ü‰wÒ ¨Ð<¨TÒ<°VÑ<ˆØ×'Ñ'¨°FÓGˆà×!Ñ! !¨°ÔBØˆro   c                ó¨  >• U R                  5       n[        R                  " U0 UD6u  ptnUR                  nUR                  n	SU;   a  UR                  S5      n
OUtp¤[        R                  " X‰X¡5      u  p¼n[        X¼UR                  UR                  5      n[        TU ],  " X}/UQ70 UD6nU R                  XáX#5      nU R                  X‰X¡Xö5        U$ )a+  
Create a 3D filled contour plot.

.. note::
    This method currently produces incorrect output due to a
    longstanding bug in 3D PolyCollection rendering.

Parameters
----------
X, Y, Z : array-like
    Input data. See `.Axes.tricontourf` for supported data shapes.
zdir : {'x', 'y', 'z'}, default: 'z'
    The direction to use.
offset : float, optional
    If specified, plot a projection of the contour lines at this
    position in a plane normal to zdir.
axlim_clip : bool, default: False
    Whether to hide lines with a vertex outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
*args, **kwargs
    Other arguments are forwarded to
    `matplotlib.axes.Axes.tricontourf`.

Returns
-------
matplotlib.tri._tricontour.TriContourSet
r[  )r  r   r‡  r   r   rH   r   r¿  r‹  rÆ  rJ   Útricontourfr±  rÏ  )re   r  r¬  r   rh   ri   r\  rŠ  rY  rZ  r[  rÁ  rÂ  rÃ  r�  r”  rl   s                   €rm   rÕ  ÚAxes3D.tricontourfÐ
  sÎ   ø€ ð@ —=‘=“?ˆä)×BÒBØð!Øñ!Ñˆ�6à�E‰EˆØ�E‰EˆØ�&‹=Ø—
‘
˜3“‰Að ˆHˆAä×&Ò& q¨QÓ5‰
ˆ�Ü˜B C§M¡M°3·8±8Ó<ˆä‰wÒ" 3Ð<¨TÒ<°VÑ<ˆØ×'Ñ'¨°FÓGˆà×!Ñ! !¨°ÔBØˆro   c                óâ  >• U R                  5       n[        R                  " U5      nUR                  (       a  [        R                  " U5      OSn[        U5      [        R                  L a(  [        R                  " XUUS9  UR                  U5        O‡[        U5      [        R                  L a(  [        R                  " XUUS9  UR                  U5        OC[        U5      [        R                  L a'  [        R                  " XUUS9  UR                  U5        U(       a½  [        U[        R                   5      (       a?  U R"                  " [        R$                  " UR&                  5      R)                  5       SU06  O_[        U[        R*                  5      (       a   U R"                  " UR,                  SS SU06  O [        U[        R.                  5      (       a   [0        T
U ]e  U5      n	U	$ )aë  
Add a 3D collection object to the plot.

2D collection types are converted to a 3D version by
modifying the object and adding z coordinate information,
*zs* and *zdir*.

Supported 2D collection types are:

- `.PolyCollection`
- `.LineCollection`
- `.PatchCollection` (currently not supporting *autolim*)

Parameters
----------
col : `.Collection`
    A 2D collection object.
zs : float or array-like, default: 0
    The z-positions to be used for the 2D objects.
zdir : {'x', 'y', 'z'}, default: 'z'
    The direction to use for the z-positions.
autolim : bool, default: True
    Whether to update the data limits.
axlim_clip : bool, default: False
    Whether to hide the scatter points outside the axes view limits.

    .. versionadded:: 3.10
r   r  r\  Nrâ  )r  r·   r  r  rÁ  Útyperý   ÚPolyCollectionr   Úpoly_collection_2d_to_3dÚset_sort_zposÚLineCollectionÚline_collection_2d_to_3dÚPatchCollectionÚpatch_collection_2d_to_3drü   rt  r]  r¸   Ú_segments3drr  r$  Ú_vecÚPatch3DCollectionrJ   r%  )re   rl  re  r  Úautolimr   r\  ÚzvalsÚzsortvalÚ
collectionrl   s             €rm   r›  ÚAxes3D.add_collection3d  s|  ø€ ð< —=‘=“?ˆä—’˜bÓ!ˆØ%*§Z§Z”B—F’F˜5”MØð 	ô �‹9œ×,Ñ,Ò,Ü×*Ò*¨3¸DØ6@òBà×Ñ˜hÕ'Ü�#‹Yœ%×.Ñ.Ò.Ü×*Ò*¨3¸DØ6@òBà×Ñ˜hÕ'Ü�#‹Yœ%×/Ñ/Ò/Ü×+Ò+¨C¸TØ7AòCà×Ñ˜hÔ'æÜ˜#œu×5Ñ5×6Ñ6Ø×#Ò#¤R§X¢X¨c¯o©oÓ%>×%HÑ%HÓ%Jð 7Ø-5ó7ä˜C¤×!7Ñ!7×8Ñ8Ø×#Ò# S§X¡X¨c¨r ]ÐF¸XÓFÜ˜C¤×!8Ñ!8×9Ñ9Øô
 ‘WÑ+¨CÓ0ˆ
ØÐro   )	rc  rd  re  r„  rG  ro  Ú	facecolorr  rH  )Úreplace_namesc                óX  >• U R                  5       nUn[        R                  " XU5      u  pn[        R                  R                  U5      n[        R                  " XX5XjR                  SS5      5      u  pp5pmU
R                  S5      b  XÚS'   [        R                  " XÃ5      (       a  UR                  5       n[        TU ],  " X/U	Q7XVS.U
D6n[        R                  " XãUUUS9  U R                  S:  a!  UR                  S:”  a  U R!                  S5        U R#                  XX;5        U$ )aƒ  
Create a scatter plot.

Parameters
----------
xs, ys : array-like
    The data positions.
zs : float or array-like, default: 0
    The z-positions. Either an array of the same length as *xs* and
    *ys* or a single value to place all points in the same plane.
zdir : {'x', 'y', 'z', '-x', '-y', '-z'}, default: 'z'
    The axis direction for the *zs*. This is useful when plotting 2D
    data on a 3D Axes. The data must be passed as *xs*, *ys*. Setting
    *zdir* to 'y' then plots the data to the x-z-plane.

    See also :doc:`/gallery/mplot3d/2dcollections3d`.

s : float or array-like, default: 20
    The marker size in points**2. Either an array of the same length
    as *xs* and *ys* or a single value to make all markers the same
    size.
c : :mpltype:`color`, sequence, or sequence of colors, optional
    The marker color. Possible values:

    - A single color format string.
    - A sequence of colors of length n.
    - A sequence of n numbers to be mapped to colors using *cmap* and
      *norm*.
    - A 2D array in which the rows are RGB or RGBA.

    For more details see the *c* argument of `~.axes.Axes.scatter`.
depthshade : bool, default: True
    Whether to shade the scatter markers to give the appearance of
    depth. Each call to ``scatter()`` will perform its depthshading
    independently.
axlim_clip : bool, default: False
    Whether to hide the scatter points outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs
    All other keyword arguments are passed on to `~.axes.Axes.scatter`.

Returns
-------
paths : `~matplotlib.collections.PathCollection`
rH  N)r„  ro  )re  r  Ú
depthshader   çš™™™™™©?r   )r  r   r
  r·   ÚmarV  Údelete_masked_pointsrN  Úmay_share_memoryÚcopyrJ   Úscatterr   rß  r0  r  r6  r]  )re   rc  rd  re  r  r„  ro  rë  r   rh   ri   r\  Úzs_origrH  Úpatchesrl   s                  €rm   rñ  ÚAxes3D.scatterH  s  ø€ ðn —=‘=“?ˆØˆä×0Ò0°¸Ó<‰
ˆ�Ü�E‰E�K‰K˜‹Nˆä"'×"<Ò"<Ø�B˜1Ÿj™j¨°$Ó7ó#Ñˆ��qð �:‰:�gÓÑ*Ø#�7‰Oô ×Ò˜w×+Ñ+Ø—‘“ˆBä‘'’/ "ÐD°TÑD¨AÑD¸VÑDˆÜ×'Ò'¨¸TØ3=Ø3=ò	?ð �=‰=˜4Ó B§G¡G¨a£KØ×Ñ˜TÔ"à×Ñ˜B BÔ1àˆro   c                ó2  >• U R                  5       n[        TU ]  " X/UQ70 UD6n	[        R                  " U[        U5      SS9n/ n
/ n[        X“5       Hq  u  pÍ[        R                  " U5      nX®R                  5       -  n
X½/[        U5      -  -  n[        R                  " XÍXE5        SU;   d  M]  UR                  US   5        Ms     [        U
5      S:”  a  [        U
6 u  nnO/ / nn[        R                  " UUX´5      u  nnnU R                  UUX¸5        U	$ )aë  
Add 2D bar(s).

Parameters
----------
left : 1D array-like
    The x coordinates of the left sides of the bars.
height : 1D array-like
    The height of the bars.
zs : float or 1D array-like, default: 0
    Z coordinate of bars; if a single value is specified, it will be
    used for all bars.
zdir : {'x', 'y', 'z'}, default: 'z'
    When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
axlim_clip : bool, default: False
    Whether to hide bars with points outside the axes view limits.

    .. versionadded:: 3.10
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs
    Other keyword arguments are forwarded to
    `matplotlib.axes.Axes.bar`.

Returns
-------
mpl_toolkits.mplot3d.art3d.Patch3DCollection
T)ÚsubokÚalphar   )r  rJ   Úbarr·   Úbroadcast_tor>  rs  r   Ú_get_patch_vertsr  Úpatch_2d_to_3dÚ	set_alphar  r]  )re   r¦  rê   re  r  r   rh   ri   r\  ró  r�  Úverts_zsrŠ  r   Úvsrc  rd  rl   s                    €rm   rø  Ú
Axes3D.bar�  s  ø€ ð> —=‘=“?ˆä‘'’+˜dÐ<¨TÒ<°VÑ<ˆä�_Š_˜R¤ T£°$Ñ7ˆàˆØˆÜ˜Ö$‰DˆAÜ×'Ò'¨Ó*ˆBØ—Y‘Y“[Ñ ˆEØ˜œc "›g™Ñ%ˆHÜ× Ò   tÔ8Ø˜&Õ Ø—‘˜F 7™OÖ,ñ %ô ˆu‹:˜‹>ô ˜%�[‰FˆB‘à˜�ˆBä ×,Ò,¨R°°XÓDÑˆˆB�Ø×Ñ˜B  HÔ7àˆro   c          	      ó   • U R                  5       n[        R                  " [        R                  " U5      X#XEU5      u  pp4pV[        R                  " U5      n[        R
                  " X-   5      n[        R                  " U5      n[        R
                  " X%-   5      n[        R                  " U5      n[        R
                  " X6-   5      n[        R                  " / SQ5      n[        R                  " UR                  UR                  -   5      nSX4SX%4SX644 Ha  u  nnnUS[        R                  [        R                  4   nUS[        R                  [        R                  4   nUUUSU4   -  -   USU4'   Mc     UR                  SUR                  SS -   5      n/ nUc  U R                  R                  5       /n[        [        R                  " U5      5      n[!        U5      [!        U5      :X  a  U H  nUR#                  U/S-  5        M     O+Un[!        U5      [!        U5      :  a  US[!        U5      -  -  n[$        R&                  " U/UQ7UUU	U
US	.UD6nU R)                  U5        U R+                  UU4UU4UU4U5        U$ )
aÚ  
Generate a 3D barplot.

This method creates three-dimensional barplot where the width,
depth, height, and color of the bars can all be uniquely set.

Parameters
----------
x, y, z : array-like
    The coordinates of the anchor point of the bars.

dx, dy, dz : float or array-like
    The width, depth, and height of the bars, respectively.

color : sequence of colors, optional
    The color of the bars can be specified globally or
    individually. This parameter can be:

    - A single color, to color all bars the same color.
    - An array of colors of length N bars, to color each bar
      independently.
    - An array of colors of length 6, to color the faces of the
      bars similarly.
    - An array of colors of length 6 * N bars, to color each face
      independently.

    When coloring the faces of the boxes specifically, this is
    the order of the coloring:

    1. -Z (bottom of box)
    2. +Z (top of box)
    3. -Y
    4. +Y
    5. -X
    6. +X

zsort : {'average', 'min', 'max'}, default: 'average'
    The z-axis sorting scheme passed onto `~.art3d.Poly3DCollection`

shade : bool, default: True
    When true, this shades the dark sides of the bars (relative
    to the plot's source of light).

lightsource : `~matplotlib.colors.LightSource`, optional
    The lightsource to use when *shade* is True.

axlim_clip : bool, default: False
    Whether to hide the bars with points outside the axes view limits.

    .. versionadded:: 3.10

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Any additional keyword arguments are passed onto
    `~.art3d.Poly3DCollection`.

Returns
-------
collection : `~.art3d.Poly3DCollection`
    A collection of three-dimensional polygons representing the bars.
))©r   r   r   ©r   r   r   ©r   r   r   ©r   r   r   )©r   r   r   ©r   r   r   ©r   r   r   ©r   r   r   )r  r  r  r  )r  r  r  r  )r  r  r  r  )r  r  r  r  r   r   r²   .)râ  Né   )Úzsortr  r  r<  r   )r  r·   rK  r  rÁ  r¼   r¸   r#  rS  ÚnewaxisÚreshaper  r  r  r  r  r>  rš  r   r$  r%  r]  )re   r   r   r   rl  rm  rn  rH  r
  r  r<  r   rh   ri   r\  r˜   r™   rš   r›   rœ   r�   Úcuboidr)  rÊ   rŠ  Údpr  ro  rl  s                                rm   Úbar3dÚAxes3D.bar3dÙ  sQ  € ðH —=‘=“?ˆä ×1Ò1Ü�MŠM˜!Ó˜a B¨Bó0Ñˆˆa�Rä�vŠv�a‹yˆÜ�vŠv�a‘f‹~ˆÜ�vŠv�a‹yˆÜ�vŠv�a‘f‹~ˆÜ�vŠv�a‹yˆÜ�vŠv�a‘f‹~ˆô
 —’ò +
ó +ˆô\ —’˜Ÿ™ 6§<¡<Ñ/Ó0ˆð ˜Q˜ a¨ Z°!°Q°Ó<‰HˆAˆq�"Ø�#”r—z‘z¤2§:¡:Ð-Ñ.ˆAØ�CœŸ™¤R§Z¡ZÐ/Ñ0ˆBØ  V¨C°¨F¡^Ñ 3Ñ3ˆE�#�q�&‹Mñ =ð —‘˜e e§k¡k°!°" oÑ5Ó6ˆàˆ
Ø‰=Ø×/Ñ/×>Ñ>Ó@ÐAˆEä”W×*Ò*¨5Ó1Ó2ˆäˆu‹:œ˜Q›Óã�Ø×!Ñ! 1 #¨¡'Ö*ò ð ˆJÜ�:‹¤ Q£Ó'Ø˜q¤3 q£6™zÑ*�
ä×$Ò$ Uð 6ð '+ñ6Ø+0Ø0:Ø+0Ø1<Ø0:ñ6ð /5ñ6ˆð 	×Ñ˜CÔ à×Ñ˜T 4˜L¨4°¨,¸¸t¸ÀhÔOàˆ
ro   c                 ó¢   >• [         TU ]  " U4X#S.UD6nU R                  R                  5       u  pgU R                  R	                  SU-  5        U$ )N)ræ  r~  gq=
×£pí?)rJ   Ú	set_titleÚtitleræ   Úset_y)	re   rê  ræ  r~  ri   Úretr   r   rl   s	           €rm   r  ÚAxes3D.set_title�  sK   ø€ ä‰gÒ ÐL°ÑLÀVÑLˆØ—‘×(Ñ(Ó*‰ˆØ�
‰
×Ñ˜ ™Ô"Øˆ
ro   g333333Ó?Útail)ÚlengthÚarrow_length_ratioÚpivotÚ	normalizer   c          
      ó¨  • S nU R                  5       n[        R                  " XX4XVSS9n[        S U 5       5      (       a*  [        R
                  " / 40 UD6nU R                  U5        U$ [        R                  " SU/[        S9nUU-  n[        R                  " / SQU	S9  U	S	:X  a  UU-  nOU	S
:X  a  UUS-  -  n[        R                  " USS 5      n[        R                  " USS 5      R                  [        5      nU
(       a:  [        R                  R                  USS9nSUUS:H  '   UUR!                  S5      -  n[#        U5      S:”  a«  U[        R$                  R'                  UU5      -
  R)                  SS5      nU" U5      nUSS2SS24   [        R$                  R'                  UU5      -
  nUR!                  [#        U5      SS45      nUR)                  SS5      n/ UQUSSS2   QUSSS2   QnO/ n[        R
                  " U4SU0UD6nU R                  U5        U R+                  USS2S4   USS2S4   USS2S4   U5        U$ )aê  
Plot a 3D field of arrows.

The arguments can be array-like or scalars, so long as they can be
broadcast together. The arguments can also be masked arrays. If an
element in any of argument is masked, then that corresponding quiver
element will not be plotted.

Parameters
----------
X, Y, Z : array-like
    The x, y and z coordinates of the arrow locations (default is
    tail of arrow; see *pivot* kwarg).

U, V, W : array-like
    The x, y and z components of the arrow vectors.

length : float, default: 1
    The length of each quiver.

arrow_length_ratio : float, default: 0.3
    The ratio of the arrow head with respect to the quiver.

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

normalize : bool, default: False
    Whether all arrows are normalized to have the same length, or keep
    the lengths defined by *u*, *v*, and *w*.

axlim_clip : bool, default: False
    Whether to hide arrows with points outside the axes view limits.

    .. versionadded:: 3.10

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Any additional keyword arguments are delegated to
    :class:`.Line3DCollection`
c           
      ó:  • U S S 2S4   nU S S 2S4   n[         R                  R                  U S S 2S S24   SS9n[         R                  " X#US:g  [         R                  " U5      S9n[         R                  " U* X3S:g  [         R
                  " U5      S9n[        R                  " S5      n[        R                  " U5      n[        R                  " U5      nXX-  n	XH-  n
XE-  SU-
  -  n[         R                  " XtS-  SU-
  -  -   X¹/X·US-  SU-
  -  -   U
* /U	* U
[         R                  " XG5      //5      nUR                  5       nU/ SQ/ SQ4==   S	-  ss'   [         R                  " S
XÀ5      n[         R                  " S
XÐ5      n[         R                  " Xï/SS9$ )Nr   r   r²   r­   )r  r¿  é   )r   r   r²   r²   )r²   r²   r   r   râ  zij...,...j->...i)r·   rÃ   rÄ   ÚdivideÚ
zeros_likeÚ	ones_likeÚmathÚradiansré  rê  r¸   Ú	full_likerð  ÚeinsumrO  )ÚUVWr   r   rÄ   Úx_pÚy_pÚranglero  r„  Úr13Úr32Úr12ÚRposÚRnegÚ	Rpos_vecsÚ	Rneg_vecss                   rm   Úcalc_arrowsÚ"Axes3D.quiver.<locals>.calc_arrows¸  sy  € à’A�q�D‘	ˆAØ’A�q�D‘	ˆAÜ—9‘9—>‘> #¢a¨¨!¨ e¡*°1�>Ð5ˆDÜ—)’)˜A¨4°1©9¼"¿-º-ÈÓ:JÑKˆCÜ—)’)˜Q˜B °Q©Y¼B¿LºLÈ»OÑLˆCä—\’\ "Ó%ˆFÜ—’˜Ó ˆAÜ—’˜Ó ˆAà‘'ˆCØ‘'ˆCØ‘)˜q 1™uÑ%ˆCÜ—8’8Ø˜a‘x A¨¡EÑ*Ñ*¨CÐ5Ø˜C 1™H¨¨Q©Ñ/Ñ/°#°Ð6Ø�$˜œRŸ\š\¨#Ó1Ð2ð4ó5ˆDð
 —9‘9“;ˆDØ’š|Ð+Ó,°Ñ2Ó,äŸ	š	Ð"4°dÓ@ˆIÜŸ	š	Ð"4°dÓ@ˆIä—8’8˜YÐ2¸Ñ;Ð;ro   T)Úcompressc              3   ó>   #   • U  H  n[        U5      S :H  v •  M     g7f)r   N)r>  )r  rý  s     rm   r  Ú Axes3D.quiver.<locals>.<genexpr>Ù  s   é € Ð/¢J˜qŒs�1‹v˜Ž{¢Jùs   ‚r,   rÙ   )r  ÚmiddleÚtip)r  r  r6  r²   NrØ   r   r­   r   )râ  r   râ  r   )r  r   r
  Úanyr   rt  r%  r·   r¸   rß   r   r³   rU  ÚastyperÃ   rÄ   r  r>  ÚmultiplyÚouterÚswapaxesr]  )re   rY  rZ  r[  ÚUr¼  ÚWr  r  r  r  r   ri   r1  r\  Ú
input_argsrƒ  Úshaft_dtÚarrow_dtÚXYZr&  rÄ   ÚshaftsÚ	head_dirsÚheadsr  s                             rm   ÚquiverÚAxes3D.quiverˆ  s@  € ò`	<ð8 —=‘=“?ˆä×0Ò0°°q¸QØ:>ñ@ˆ
ô Ñ/¡JÓ/×/Ñ/ä×*Ò*¨2Ñ8°Ñ8ˆEØ×Ñ Ô&ØˆLä—8’8˜R ˜L´Ñ6ˆØÐ0Ñ0ˆä×ÒÒ4¸EÒBØ�F‹?Ø˜Ñ‰HØ�hÓØ˜ ™
Ñ"ˆHä�oŠo˜j¨¨!˜nÓ-ˆÜ�oŠo˜j¨¨˜nÓ-×4Ñ4´UÓ;ˆö Ü—9‘9—>‘> #¨A�>Ð.ˆDØˆD�˜‘‰OØ˜Ÿ™ WÓ-Ñ-ˆCäˆs‹8�a‹<àœBŸK™K×-Ñ-¨h¸Ó<Ñ<×FÑFÀqÈ!ÓLˆFá# CÓ(ˆIàš1˜b˜q˜b˜5‘M¤B§K¡K×$5Ñ$5°hÀ	Ó$JÑJˆEà—M‘M¤3 x£=°"°aÐ"8Ó9ˆEà—N‘N 1 aÓ(ˆEà8�fÐ8˜u¡S q S™zÐ8¨E°!°$°Q°$©KÐ8‰EàˆEä×&Ò& uÑN¸ÐNÀvÑNˆØ×Ñ˜EÔ"à×Ñ˜C¢ 1 ™I sª1¨a¨4¡y°#²a¸°d±)¸XÔFàˆro   ©r  rG  r  r<  r   c          
      ó  ^2^3• [        U5      S:¼  a  S nOS nU" U0 UD6u  n	m3nT3R                  S:w  a  [        S5      e[        R                  " T3R
                  [        R                  S9n
[        U
S-   5      m2U	c  [        R                  " T25      u  p¼nOU24S jU	 5       u  p¼nU34S	 jnUc  U R                  R                  5       nU" US
5      nU" US5      nU R                  X¼U5        [        R                  " / SQ/ SQ/ SQ/ SQ/[        R                  S9n[        [        5      nS nU" S5       GHò  nUR                  R                  U
5      u  nnn[        R                   " U5      n[        R                   " U5      n[        R                   " U5      nUR                  UR                  5      nUSSS2   nU GHc  nU GHX  nUR                  UUS/5      n[        U5      nT3U   (       a  UU   R#                  UU-   5        [$        R&                  " U5       H   u  nn UR                  UUU/5      n!UR                  UUU /5      n"[        U!5      n#[        U"5      n$T3U#   (       a#  T3U$   (       d  UU#   R#                  U"U-   5        Mq  T3U#   (       a  M}  T3U$   (       d  M‰  UU$   R#                  U"U-   5        M¢     UR                  UUUS-
  /5      n%UR                  UUU/5      n&[        U%5      n'T3U'   (       d  GMA  UU'   R#                  U&U-   5        GM[     GMf     GMõ     0 n(UR)                  5        HÂ  u  n)n*U	c  U*n+Oz/ n+U* Hr  n,U,SS2S4   U,SS2S4   U,SS2S4   4n-[        R*                  " U,R
                  5      n.UU-   U.SS2S4'   UU-   U.SS2S4'   UU-   U.SS2S4'   U+R#                  U.5        Mt     UU)   n/UU)   n0[,        R.                  " U+4U/U0X4US.UD6n1U R1                  U15        U1U(U)'   MÄ     U($ )aw	  
ax.voxels([x, y, z,] /, filled, facecolors=None, edgecolors=None, **kwargs)

Plot a set of filled voxels

All voxels are plotted as 1x1x1 cubes on the axis, with
``filled[0, 0, 0]`` placed with its lower corner at the origin.
Occluded faces are not plotted.

Parameters
----------
filled : 3D np.array of bool
    A 3D array of values, with truthy values indicating which voxels
    to fill

x, y, z : 3D np.array, optional
    The coordinates of the corners of the voxels. This should broadcast
    to a shape one larger in every dimension than the shape of
    *filled*.  These can be used to plot non-cubic voxels.

    If not specified, defaults to increasing integers along each axis,
    like those returned by :func:`~numpy.indices`.
    As indicated by the ``/`` in the function signature, these
    arguments can only be passed positionally.

facecolors, edgecolors : array-like, optional
    The color to draw the faces and edges of the voxels. Can only be
    passed as keyword arguments.
    These parameters can be:

    - A single color value, to color all voxels the same color. This
      can be either a string, or a 1D RGB/RGBA array
    - ``None``, the default, to use a single color for the faces, and
      the style default for the edges.
    - A 3D `~numpy.ndarray` of color names, with each item the color
      for the corresponding voxel. The size must match the voxels.
    - A 4D `~numpy.ndarray` of RGB/RGBA data, with the components
      along the last axis.

shade : bool, default: True
    Whether to shade the facecolors.

lightsource : `~matplotlib.colors.LightSource`, optional
    The lightsource to use when *shade* is True.

axlim_clip : bool, default: False
    Whether to hide voxels with points outside the axes view limits.

    .. versionadded:: 3.10

**kwargs
    Additional keyword arguments to pass onto
    `~mpl_toolkits.mplot3d.art3d.Poly3DCollection`.

Returns
-------
faces : dict
    A dictionary indexed by coordinate, where ``faces[i, j, k]`` is a
    `.Poly3DCollection` of the faces drawn for the voxel
    ``filled[i, j, k]``. If no faces were drawn for a given voxel,
    either because it was not asked to be drawn, or it is fully
    occluded, then ``(i, j, k) not in faces``.

Examples
--------
.. plot:: gallery/mplot3d/voxels.py
.. plot:: gallery/mplot3d/voxels_rgb.py
.. plot:: gallery/mplot3d/voxels_torus.py
.. plot:: gallery/mplot3d/voxels_numpy_logo.py
rØ   c                 ó   • XU4X44$ rû   rÓ   )Ú
_Axes3D__xÚ
_Axes3D__yÚ
_Axes3D__zÚfilledri   s        rm   ÚvoxelsÚAxes3D.voxels.<locals>.voxelsX  s   € Ø #�¨Ð6Ð6ro   c                 ó
   • S X4$ rû   rÓ   )rN  ri   s     rm   rO  rP  [  s   € Ø˜VÐ+Ð+ro   z%Argument filled must be 3-dimensionalrÙ   r   Nc              3   óR   >#   • U  H  n[         R                  " UT5      v •  M     g 7frû   )r·   rù  )r  ro  Úcoord_shapes     €rm   r  Ú Axes3D.voxels.<locals>.<genexpr>j  s   øé € ÐDÂ¸1”r—’ q¨+×6Ð6Âùs   ƒ$'c                 ój  >• [         R                  " U 5      S;   a8  [         R                  " U TR                  [         R                  " U 5      -   5      $ [         R                  " U 5      S;   a8  [         R                  " U 5      S S TR                  :w  a  [	        SU S35      eU $ [	        SU S35      e)N)r   r   )rØ   r×   rØ   zWhen multidimensional, z must match the shape of filledzInvalid z	 argument)r·   rI  rù  rS  rÝ   )rH  rÕ  rN  s     €rm   Ú_broadcast_color_argÚ+Axes3D.voxels.<locals>._broadcast_color_argl  s™   ø€ Ü�wŠw�u‹~ Ó'ä—’ u¨f¯l©l¼R¿XºXÀe»_Ñ.LÓMÐMÜ—’˜“ 6Ó)ä—8’8˜E“? 2 AÐ&¨&¯,©,Ó6Ü$Ø1°$°ð 8$ð $ó%ð %ð �ä  8¨D¨6°Ð!;Ó<Ð<ro   r  rG  r  r  r  r  c              3   óª   #   • [         R                  " U [         R                  S9n[        U 5       H  nUv •  [         R                  " USSS9nM     g7f)z%Generate cyclic permutation matrices.rÙ   r   r   r­   N)r·   rû  Úintprx  r$   )ÚnÚmatrÊ   s      rm   Úpermutation_matricesÚ+Axes3D.voxels.<locals>.permutation_matrices�  s>   é € ä—&’&˜¤"§'¡'Ñ*ˆCÜ˜1–X�Ø’	Ü—g’g˜c 1¨1Ñ-’ò ùs   ‚AArâ  r   r²   rH  )r>  rI  rÝ   r·   r¸   rS  rY  rµ  Úindicesr  r  r]  r   r  r°  rò  Úarangerv  rQ  rR  Úitemsr#  r   r$  r›  )4re   r  rG  r  r<  r   rh   ri   rO  Úxyzr  r   r   r   rV  ÚsquareÚvoxel_facesr\  ÚpermuteÚpcÚqcÚrcÚpindsÚqindsÚrindsÚsquare_rot_posÚsquare_rot_negrŠ  r¢  r÷  Úi0Úr1r†  rø  rù  Úi1Úi2ÚpkÚpk2ÚikÚpolygonsÚcoordÚ
faces_indsÚfacesÚ	face_indsÚindÚfacerè  Ú	edgecolorr6  rS  rN  s4                                                     @@rm   rO  ÚAxes3D.voxels
  sì  ù€ ôX ˆt‹9˜‹>ó7ò,ñ % dÐ5¨fÑ5ÑˆˆV�Vð �;‰;˜!ÓÜÐDÓEÐEÜ�xŠx˜Ÿ™¬B¯G©GÑ4ˆô ˜D 1™H“oˆØ‰;Ü—j’j Ó-‰GˆA‘!äDÁÓD‰GˆA�!õ	=ð ÑØ×3Ñ3×BÑBÓDˆJÙ)¨*°lÓCˆ
ñ *¨*°lÓCˆ
ð 	×Ñ˜A !Ô$ô —’ÚÚÚÚð	
ô
 —‘ñˆô "¤$Ó'ˆò	.ñ ,¨A×.ˆGà Ÿ™Ÿ™ tÓ,‰JˆB��BÜ—I’I˜b“MˆEÜ—I’I˜b“MˆEÜ—I’I˜b“MˆEà#ŸZ™Z¨¯	©	Ó2ˆNØ+©D¨b¨DÑ1ˆNô �Ü�Að !Ÿ™ a¨¨A YÓ/�BÜ˜r›�BØ˜b—zØ# B™×.Ñ.¨r°NÑ/BÔCô #,×"4Ò"4°UÖ";™˜˜BØ$Ÿ[™[¨!¨Q°¨Ó4˜Ø$Ÿ[™[¨!¨Q°¨Ó4˜ä" 2›Y˜Ü" 2›Y˜à! "Ÿ:¨f°R¯jØ'¨™O×2Ñ2°2¸Ñ3FÖGØ!'¨§¡°°r·
±
Ø'¨™O×2Ñ2°2¸Ñ3FÖGñ #<ð !Ÿ™ a¨¨B¨q©D \Ó2�BØ!Ÿ+™+ q¨!¨R jÓ1�CÜ˜r›�BØ˜b—z’zØ# B™×.Ñ.¨s°^Ñ/C×Dô; ô ñ /ðZ ˆØ!,×!2Ñ!2Ö!4ÑˆE�:à‰{Ø"‘à�Û!+�IØ#¢A q D™/¨9²Q¸°T©?¸IÂaÈÀd¹OÐK�CÜŸ8š8 I§O¡OÓ4�DØ!" 3¡�Dš˜A˜‘JØ!" 3¡�Dš˜A˜‘JØ!" 3¡�Dš˜A˜‘JØ—L‘L Ö&ñ ",ð # 5Ñ)ˆIØ" 5Ñ)ˆIä×)Ò)ØðØ"+¸	ØÀñð ñˆDð ×!Ñ! $Ô'Ø"ˆH�U‹Oñ/ "5ð2 ˆro   )r   r   r   ÚxerrÚyerrÚzerrc                 ó  ^M^N• U R                  5       n[        R                  " U[        R                  5      nUR                  5        VVs0 s H  u  nnUc  M  UU_M     nnnUR                  SS5        U R                  SU4SU4SU4/USS9  [        R                  " U5      (       a  UOU/n[        R                  " U5      (       a  UOU/n[        R                  " U5      (       a  UOU/n[        U5      [        U5      s=:X  a  [        U5      :X  d  O  [        S	5      eU R                  X5      mMUR                  S
S5      nSUS
'   U R                  R                  XS:X  a  X4OXU4USS9u  u  nn[         R"                  " UUUS9  U(       a  UR%                  US   S-
  5        OUR%                  US   S-   5        UR'                  5       S:w  a  U R)                  U5        OSnUR                  S5        SU;  a  SUS'   U
c  US   n
S H  nUR                  US5        M     0 UESU
0EnU(       a  UUS'   OSU;   a  US   US'   S H  nUU;   d  M  UU   UU'   M     0 UESS0EnUc  [*        R,                  S   nUS:”  a  SU-  US'   Ub  UUS'   U
US'   S nUM4S jn / / / n#n"n!/ n$S S S!S".n%SS#SS$.mNUR/                  S[*        R,                  S%   5      S-  n&U&U R1                  SS&9R2                  S'-  -  n&U R4                  R7                  5       R9                  S(U&U&4/5      n&[        R:                  " [        R<                  " U&SS)95      n&[        R>                  " U SSSS*9   [        R@                  RC                  U RE                  5       5      n'SSS5        [        RF                  " W'U&SSS/5      S#   n&U&S+-  n&0 UEU&S#S,.En(U(R                  SS5        [I        / S$QXU/XeU/UUU/UUU/5       GH¸  u  n)n*n+n,n-[         RJ                  " U)5      n.TNU)   n/U+c  M*  [        R                  " U+5      (       d  U+/[        U*5      -  n+[        RL                  " U+5      n+[        RN                  " U,[        U*5      5      RQ                  [R        5      n,[        RN                  " U-[        U*5      5      RQ                  [R        5      n-[U        XU/5       V0V1s/ s H  u  n0n1U " U+U.U0   -  U1U,U-5      PM     n2n0n1U2u  u  n3n4u  n5n6u  n7n8U,U--  ) n9U9RW                  5       (       a¢  US:”  aœ  U" U3U5U7/U9TM-  5      n:U" U4U6U8/U9TM-  5      n;[         RX                  " U:SU%U/   US-.UD6n<[         RX                  " U;SU%U/   US-.UD6n=U R)                  U<5        U R)                  U=5        U"R[                  U<5        U"R[                  U=5        U,RW                  5       (       a+  U" U4U6U8/U,TM-  5      u  n>n?n@U R\                  " U>U?U@/U.Q70 U(D6  U-RW                  5       (       a,  U" U3U5U7/U-TM-  5      u  nAnBnCU R\                  " UAUBUC/U.* Q70 U(D6  [         R^                  " [        R`                  " U25      Rb                  4S.U0UD6nDU Re                  UD5        U!R[                  UD5        U$R[                  U25        GM»     [        R`                  " U$5      n$UN4S/ jnEUE" U$S5      u  nFnGUE" U$S5      u  nHnIUE" U$S5      u  nJnKU Rg                  UFUG4UHUI4UJUK4U5        [h        Rj                  " U[m        U"5      [m        U!5      4USL=(       d    USLUSLUS09nLU Rn                  R[                  UL5        U!U"U#4$ s  snnf ! , (       d  f       GNà= fs  sn1n0f )1aÇ  
Plot lines and/or markers with errorbars around them.

*x*/*y*/*z* define the data locations, and *xerr*/*yerr*/*zerr* define
the errorbar sizes. By default, this draws the data markers/lines as
well the errorbars. Use fmt='none' to draw errorbars only.

Parameters
----------
x, y, z : float or array-like
    The data positions.

xerr, yerr, zerr : float or array-like, shape (N,) or (2, N), optional
    The errorbar sizes:

    - scalar: Symmetric +/- values for all data points.
    - shape(N,): Symmetric +/-values for each data point.
    - shape(2, N): Separate - and + values for each bar. First row
      contains the lower errors, the second row contains the upper
      errors.
    - *None*: No errorbar.

    Note that all error arrays should have *positive* values.

fmt : str, default: ''
    The format for the data points / data lines. See `.plot` for
    details.

    Use 'none' (case-insensitive) to plot errorbars without any data
    markers.

ecolor : :mpltype:`color`, default: None
    The color of the errorbar lines.  If None, use the color of the
    line connecting the markers.

elinewidth : float, default: None
    The linewidth of the errorbar lines. If None, the linewidth of
    the current style is used.

capsize : float, default: :rc:`errorbar.capsize`
    The length of the error bar caps in points.

capthick : float, default: None
    An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*).
    This setting is a more sensible name for the property that
    controls the thickness of the error bar cap in points. For
    backwards compatibility, if *mew* or *markeredgewidth* are given,
    then they will over-ride *capthick*. This may change in future
    releases.

barsabove : bool, default: False
    If True, will plot the errorbars above the plot
    symbols. Default is below.

xlolims, ylolims, zlolims : bool, default: False
    These arguments can be used to indicate that a value gives only
    lower limits. In that case a caret symbol is used to indicate
    this. *lims*-arguments may be scalars, or array-likes of the same
    length as the errors. To use limits with inverted axes,
    `~.set_xlim`, `~.set_ylim`, or `~.set_zlim` must be
    called before `errorbar`. Note the tricky parameter names: setting
    e.g. *ylolims* to True means that the y-value is a *lower* limit of
    the True value, so, only an *upward*-pointing arrow will be drawn!

xuplims, yuplims, zuplims : bool, default: False
    Same as above, but for controlling the upper limits.

errorevery : int or (int, int), default: 1
    draws error bars on a subset of the data. *errorevery* =N draws
    error bars on the points (x[::N], y[::N], z[::N]).
    *errorevery* =(start, N) draws error bars on the points
    (x[start::N], y[start::N], z[start::N]). e.g. *errorevery* =(6, 3)
    adds error bars to the data at (x[6], x[9], x[12], x[15], ...).
    Used to avoid overlapping error bars when two series share x-axis
    values.

axlim_clip : bool, default: False
    Whether to hide error bars that are outside the axes limits.

    .. versionadded:: 3.10

Returns
-------
errlines : list
    List of `~mpl_toolkits.mplot3d.art3d.Line3DCollection` instances
    each containing an errorbar line.
caplines : list
    List of `~mpl_toolkits.mplot3d.art3d.Line3D` instances each
    containing a capline object.
limmarks : list
    List of `~mpl_toolkits.mplot3d.art3d.Line3D` instances each
    containing a marker with an upper or lower limit.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    All other keyword arguments for styling errorbar lines are passed
    `~mpl_toolkits.mplot3d.art3d.Line3DCollection`.

Examples
--------
.. plot:: gallery/mplot3d/errorbar3d.py
Nr  r²   r   r   r   F)Úconvertz)'x', 'y', and 'z' must have the same sizerê  Ú
_nolegend_rM  T)Úreturn_kwargs)re  r   gš™™™™™¹?ÚnonerH  ÚC0)ÚmarkerÚ
markersizeÚmarkerfacecolorÚmarkeredgewidthÚmarkeredgecolorÚ	markeveryÚ	linestyleÚ	fillstyleÚ	drawstyleÚdash_capstyleÚdash_joinstyleÚsolid_capstyleÚsolid_joinstyleÚ	linewidth)r`   r÷  r  Ú
rasterizedrŒ  ÚNonezerrorbar.capsizer   r¯   r‡  r‰  c                 ó^   • U  Vs/ s H  n/ [         R                  " X!5      QPM     sn$ s  snf rû   )rQ  r3  )ÚarraysrÆ  r¸   s      rm   Ú_apply_maskÚ$Axes3D.errorbar.<locals>._apply_mask£  s/   € ñ EKÓKÂF¸5Ð6”i×(Ò(¨Ó5Ó6ÁFÑKÐKùÒKs   …"*c                 óÂ   >• [        U R                  5      S:X  a  U u  pEOX pT[        R                  " UT) -  XU-
  5      n[        R                  " UT) -  XU-   5      nXg4$ )Nr²   )r>  rS  r·   r  )	ÚerrÚdataÚlomaskÚhimaskÚlow_errÚhigh_errÚlowsÚhighsÚ	everymasks	           €rm   Ú_extract_errsÚ&Axes3D.errorbar.<locals>._extract_errs¨  s`   ø€ ä�3—9‘9‹~ Ó"Ø$'Ñ!�˜à$'˜ä—8’8˜F i ZÑ/°¸g±~ÓFˆDÜ—H’H˜V y jÑ0°$¸x¹ÓHˆEà�;Ðro   Ú|Ú_rÒ   r   r   zlines.markersizer3   éH   r8   r­   )r"   r#   r$   gV&,t=Ûý?)r  r  )Úlsr†  r   r   c           	      óœ   >• [         R                  " U S S 2TU   S S 2S S 24   5      [         R                  " U S S 2TU   S S 2S S 24   5      4$ rû   )r·   rÊ  rË  )Úerr_arrÚcoord_labelÚi_xyzs     €rm   Ú_digout_minmaxÚ'Axes3D.errorbar.<locals>._digout_minmax  sM   ø€ Ü—I’I˜g¢a¨¨{Ñ);ºQÂÐ&AÑBÓCÜ—I’I˜g¢a¨¨{Ñ);ºQÂÐ&AÑBÓCðEð Ero   )Úhas_xerrÚhas_yerrrê  )8r  r   Únormalize_kwargsrc  rd  r`  Ú
setdefaultÚ_process_unit_infor·   r}  r>  rÝ   Ú_errorevery_to_maskrH   r[  Ú
_plot_argsr   r  Ú
set_zorderr€  Úadd_linerž  rŸ  rN  rT   ÚdpiÚ	transAxesr_   r`   r»   r¶  Ú_setattr_cmrÃ   r  r  rò  rs  Úget_dir_vectorr  rù  r9  re  r¾   r8  ÚLine3Drv  rF  rt  r¸   r°  r%  r]  Ú
mcontainerÚErrorbarContainerrµ  Ú
containers)Ore   r   r   r   r  r~  r}  ÚfmtÚ	barsaboveÚ
erroreveryÚecolorÚ
elinewidthÚcapsizeÚcapthickÚxlolimsÚxuplimsÚylolimsÚyuplimsÚzlolimsÚzuplimsr   ri   r\  r£  rý  rê  Ú	data_lineÚ
base_styler  Úeb_lines_styleÚeb_cap_styler˜  r¤  ÚerrlinesÚcaplinesÚlimmarksÚ	coorderrsÚ	capmarkerÚ
quiversizerO   Úeb_quiver_styler  rœ  r›  ÚlolimsÚuplimsÚ
dir_vectorÚi_zdirrÊ   ru  Úcoorderrr€  Úxhr�  Úyhr‚  ÚzhÚnolimsÚlo_caps_xyzÚhi_caps_xyzÚcap_loÚcap_hiÚxh0Úyh0Úzh0Úxl0Úyl0Úzl0Úerrliner®  r˜   r™   rš   r›   rœ   r�   Úerrorbar_containerr£  r­  sO                                                                                @@rm   ÚerrorbarÚAxes3D.errorbará  sÍ  ù€ ðb —=‘=“?ˆä×'Ò'¨´·±Ó>ˆà#)§<¡<¤>ÔC¢>™4˜1˜a°Q“$�!�Q’$¡>ˆÑCØ×Ñ˜( AÔ&à×Ñ # q ¨C°¨8°c¸1°XÐ >ÀØ(-ð 	 ñ 	/ô
 —’˜Q—‘‰A a SˆÜ—’˜Q—‘‰A a SˆÜ—’˜Q—‘‰A a Sˆä�1‹vœ˜Q›Õ)¤3 q£6Õ)ÜÐHÓIÐIà×,Ñ,¨QÓ;ˆ	à—
‘
˜7 DÓ)ˆØ&ˆˆw‰ð $(§?¡?×#=Ñ#=Ø 2›I�1‘&¨A°#¨;¸Èdð $>ð $TÑ Ñˆ�Jä×Ò˜I¨!¸
ÒCö Ø× Ñ  ¨Ñ!1°BÑ!6Õ7à× Ñ  ¨Ñ!1°BÑ!6Ô7ð �9‰9‹;˜&Ó Ø�M‰M˜)Õ$àˆIà�N‰N˜7Ô#à˜*Ó$Ø"&ˆJ�wÑØ‰>Ø Ñ(ˆFóKˆCð �N‰N˜3 Ö%ñ	Kð 9˜JÐ8¨°Ñ8ˆæØ*4ˆN˜;Ò'Ø˜FÓ"Ø*0°Ñ*=ˆN˜;Ñ'ãAˆCØ�f�}Ø&,¨S¡k�˜sÓ#ñ Bð
 ;˜*Ð: k°6Ñ:ˆØ‰?Ü—l‘lÐ#5Ñ6ˆGØ�Q‹;Ø)+¨g©ˆL˜Ñ&ØÑØ.6ˆLÐ*Ñ+Ø &ˆ�WÑò	Lõ

	ð (*¨2¨r˜H�(ˆð ˆ	ð  ¨Ñ,ˆ	Ø˜a aÑ(ˆð "×%Ñ% lÜ&)§l¡lÐ3EÑ&FóHØKLñMˆ
à�d—o‘o¨4�oÐ0×4Ñ4°rÑ9Ñ9ˆ
Ø—^‘^×,Ñ,Ó.×8Ñ8Ø�Z Ð,ð:.ó /ˆ
ä—W’WœRŸWšW Z°aÑ8Ó9ˆ
ô ×Ò˜t¨!°!¸!Ó<Ü—9‘9—=‘= §¡£Ó1ˆD÷ =ô —V’V˜D :¨q°!°QÐ"7Ó8¸Ñ;ˆ
ð 	Ð(Ñ(ˆ
ðJ˜\ð JØ%/ÀqòJˆà×Ñ˜L¨$Ô/ô 03Ú !¨ ¨T¸Ð,>Ø˜' 7Ð+¨g°wÀÐ-H÷0JÑ+ˆD�$˜˜V Vô ×-Ò-¨dÓ3ˆJØ˜4‘[ˆFà‰{Ùä—;’;˜s×#Ñ#Ø�eœc $›iÑ'�ä—-’- Ó$ˆCô —_’_ V¬S°«YÓ7×>Ñ>¼tÓDˆFÜ—_’_ V¬S°«YÓ7×>Ñ>¼tÓDˆFô !*¨1°¨)Ô 4ô6â 4‘H�A�uñ ˜c J¨q¡MÑ1°5¸&À&ÖIÙ 4ð ñ 6ð ,4Ñ(‰HˆR�‘h�r˜2¡  Rð  ‘Ð'ˆFØ�z‰z�|‰| ¨!£Ù)¨2¨r°2¨,¸ÀÑ8JÓK�Ù)¨2¨r°2¨,¸ÀÑ8JÓK�ô Ÿš {°rØ-6°vÑ->Ø1;ñ6ð )5ñ6�ô Ÿš {°rØ-6°vÑ->Ø1;ñ6ð )5ñ6�ð —‘˜fÔ%Ø—‘˜fÔ%Ø—‘ Ô'Ø—‘ Ô'à�z‰z�|‰|Ù +¨R°°R¨L¸&À9Ñ:LÓ M‘��S˜#Ø—’˜C  cÐJ¨JÒJ¸/ÒJØ�z‰z�|‰|Ù +¨R°°R¨L¸&À9Ñ:LÓ M‘��S˜#Ø—’˜C  cÐK¨Z¨KÒK¸?ÒKä×,Ò,¬R¯XªX°hÓ-?×-AÑ-Añ ?Ø8Bð?à/=ñ?ˆGð ×Ñ Ô(Ø�O‰O˜GÔ$Ø×Ñ˜X×&ñy0Jô| —H’H˜YÓ'ˆ	õ	Eñ $ I¨sÓ3‰
ˆˆdÙ# I¨sÓ3‰
ˆˆdÙ# I¨sÓ3‰
ˆˆdØ×Ñ˜T 4˜L¨4°¨,¸¸t¸ÀhÔOô (×9Ò9Øœ˜h›¬¨x«Ð9Ø $Ð&×:¨$°dÐ*:Ø $Ð&Øñ	Ðð
 	�‰×ÑÐ1Ô2à˜ 8Ð+Ð+ùóm D÷n =Ö<üóH6s   Á
]/Á]/Í..]5Ó^Ý5
^©Úcall_axes_locatorÚbbox_extra_artistsÚfor_layout_onlyc                óZ  >• [         T	U ]  UUUUS9nU/nU R                  (       ah  U R                  R	                  5        HJ  nUR                  5       (       d  M  [        R                  " Xq5      nU(       d  M9  UR                  U5        ML     [        R                  R                  U5      $ )Nrð  )rJ   Úget_tightbboxrr   r  r  r  ÚmartistÚ_get_tightbbox_for_layout_onlyrv  rè   r   Úunion)
re   r  rñ  rò  ró  r  Úbatchr®   Úaxis_bbrl   s
            €rm   rõ  ÚAxes3D.get_tightbbox.  s–   ø€ ä‰gÑ# HØ6GØ7IØ4Cð $ð Eˆð �ˆØ�>�>ØŸ™×-Ñ-Ö/�Ø×#Ñ#×%Ó%Ü%×DÒDØó(�Gç�wØŸ™ WÖ-ñ 0ô ×Ñ×%Ñ% eÓ,Ð,ro   zC0-ÚC0ozC3-)ÚlinefmtÚ	markerfmtÚbasefmtr¬  rê  Úorientationr   c          	      óx  • SSK Jn  U R                  5       n[        R                  " / SQU	S9  [
        R                  " U5      [
        R                  " U5      4n[
        R                  " U5      [
        R                  " U5      4n[
        R                  " U5      [
        R                  " U5      4nU	S:X  a3  X.nnX?nn[        XU5       VVVs/ s H  u  nnnUUU4UUU4/PM     nnnnOkU	S:X  a3  XnnX?nn[        XU5       VVVs/ s H  u  nnnUUU4UUU4/PM     nnnnO2XnnX.nn[        XU5       VVVs/ s H  u  nnnUUU4UUU4/PM     nnnn[        U5      u  nnnUc  [        R                  S   nU R                  UUXgU	SS	9u  n[        R                  " UUUSU
S
9nU R                  U5        U R                  XX5SS9u  nU" UUU4US9nU R!                  U5        [        R"                  " UUXw/U	5      u  nn n!U R%                  / UQUQ/ U QUQ/ U!QUQU5        U$ s  snnnf s  snnnf s  snnnf )aì  
Create a 3D stem plot.

A stem plot draws lines perpendicular to a baseline, and places markers
at the heads. By default, the baseline is defined by *x* and *y*, and
stems are drawn vertically from *bottom* to *z*.

Parameters
----------
x, y, z : array-like
    The positions of the heads of the stems. The stems are drawn along
    the *orientation*-direction from the baseline at *bottom* (in the
    *orientation*-coordinate) to the heads. By default, the *x* and *y*
    positions are used for the baseline and *z* for the head position,
    but this can be changed by *orientation*.

linefmt : str, default: 'C0-'
    A string defining the properties of the vertical lines. Usually,
    this will be a color or a color and a linestyle:

    =========  =============
    Character  Line Style
    =========  =============
    ``'-'``    solid line
    ``'--'``   dashed line
    ``'-.'``   dash-dot line
    ``':'``    dotted line
    =========  =============

    Note: While it is technically possible to specify valid formats
    other than color or color and linestyle (e.g. 'rx' or '-.'), this
    is beyond the intention of the method and will most likely not
    result in a reasonable plot.

markerfmt : str, default: 'C0o'
    A string defining the properties of the markers at the stem heads.

basefmt : str, default: 'C3-'
    A format string defining the properties of the baseline.

bottom : float, default: 0
    The position of the baseline, in *orientation*-coordinates.

label : str, optional
    The label to use for the stems in legends.

orientation : {'x', 'y', 'z'}, default: 'z'
    The direction along which stems are drawn.

axlim_clip : bool, default: False
    Whether to hide stems that are outside the axes limits.

    .. versionadded:: 3.10

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

Returns
-------
`.StemContainer`
    The container may be treated like a tuple
    (*markerline*, *stemlines*, *baseline*)

Examples
--------
.. plot:: gallery/mplot3d/stem3d_demo.py
r   )ÚStemContainerr   )r   r   r   zlines.linestyler‚  )re  r  rê  )Ú
linestylesr   rê  r   )rê  )Úmatplotlib.containerr  r  r   r³   r·   rÁ  r¼   rs  r
   rž  rŸ  r  r   rt  r%  Úadd_containerr  r]  )"re   r   r   r   rý  rþ  rÿ  r¬  rê  r   r   r  r\  r   r   r   ÚbasexÚbasexlimÚbaseyÚbaseylimÚthisxÚthisyÚthiszr  rŒ  Ú
linemarkerÚ	linecolorÚbaselineÚ	stemlinesÚ
markerlineÚstem_containerÚjxÚjyÚjzs"                                     rm   ÚstemÚAxes3D.stem>  s‰  € õN 	7à—=‘=“?ˆä×Òš?¸ÒDä—’�q“	œ2Ÿ6š6 !›9Ð%ˆÜ—’�q“	œ2Ÿ6š6 !›9Ð%ˆÜ—’�q“	œ2Ÿ6š6 !›9Ð%ˆð ˜#ÓØ�8ˆEØ�8ˆEä03°A¸!´õ>Ú0<Ñ,˜  uð ˜u eÐ,¨u°e¸UÐ.CÓDÙ0<ð ò >ˆEà˜CÓØ�8ˆEØ�8ˆEä03°A¸!´õ>Ú0<Ñ,˜  uð ˜f eÐ,¨u°e¸UÐ.CÓDÙ0<ð ò >ˆEð  �8ˆEØ�8ˆEä03°A¸!´õ>Ú0<Ñ,˜  uð ˜e VÐ,¨u°e¸UÐ.CÓDÙ0<ð ò >ô ,@ÀÓ+HÑ(ˆ	�:˜yØÑÜŸ™Ð%6Ñ7ˆIð —I‘I˜e U¨GØ#.°lð ð D‰	ˆä×*Ò*Ø˜i°	ÀØ!ñ#ˆ	ð 	×Ñ˜IÔ&Ø—i‘i  a¸,�iÐG‰ˆ
á&¨
°I¸xÐ'HØ-2ñ4ˆà×Ñ˜>Ô*ä×&Ò& x°¸FÐ;KØ'2ó4‰
ˆˆB�à×Ñ˜L˜b˜L 4˜L¨,¨B¨,°¨,¸¸"¸¸t¸ÀhÔOàÐùôG>ùô
>ùô
>s   ÃH'ÄH.Ä:H5)*rN   rF   rµ   rr   r½   r   rï  rÜ  r  r	  rb   ra   r  rG   rC   r-  r.  r`  rP   rì  rí  rî  r0  r
  r#   r  r*   r"   rR   r9   r:   r;   rO   r$   rs   rŠ   r@   r>   rŒ   rz   rA   r?   rû   )NNF)TrG  N)NN)NTTT)NNN)NNNr   F)F)r   r²   rØ   )ÚinNFF)T)rG  )r’  )Fr’  r   NF)r   N)r   NF)r   r   T)r   r   é   NT)r   r   )NÚaverageTN)NÚcenter)NNNrM  Fr   NNNNFFFFFFF)”Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rÕ  rÑ  r   ÚGrouperr   rD   rK   rL   rM   r|   r[   rŽ   r‘   r	   Úget_zgridlinesÚget_zticklinesrŸ   r´   r¶   rÅ   r÷   rö  Úallow_rasterizationr  r'  r+  rN  rM  r1  r6  rD  rP  r]  rQ   r"  r„  ri  rj  rk  r¡  rˆ  r�  r”  r¿   rÀ   rÁ   r¶  rº  r½  Ú
get_zscaleÚ
set_xscaleÚ
set_yscaleÚ
set_zscaleÚmapÚformatÚ
get_zticksÚ
set_zticksÚget_zmajorticklabelsÚget_zminorticklabelsÚget_zticklabelsÚset_zticklabelsÚ
zaxis_dateÚtextwrapÚdedentrÊ  rB   r<   re  r·   rT  rá   r  rS   r  r  r  r&   r%   r$  rY   rZ   r>  rC  rJ  rS  rN  rO  rq  r_  rß   rŒ  rX   rš  rë  rÒ  rÃ  rœ  rh  rç  rì  Úget_frame_onÚset_frame_onr%  rõ  rû  r•  r“  r  Útext3DÚtext2Dr  Úplot3Dr8  ro  r„  r�  r§  r­  r²  r±  r   rÀ  Ú	contour3DrÇ  rÏ  rÒ  Ú
contourf3DrÕ  r›  rñ  Ú	scatter3Drø  r  r  rF  Úquiver3DrO  rî  rõ  r  Ústem3DÚ__static_attributes__Ú__classcell__)rl   s   @rm   r   r   )   s—  ø† ñð €Dà!€KØ"Ÿ]š]›_€D×Ñ�cÑØ %§¢£€D×Ñ�fÑð ðD*à�c ¨T¸$Ø¨ØØ÷D*ñ D*òLòò+ò
ò(òñ *¨'°?ÓC€NÙ)¨'°?ÓC€Nò1÷T0òlð* ./õ 'ôRJð" × Ñ ô9ó !ð9òv#òñ -¨WÐ6IÓJÐÙ,¨WÐ6IÓJÐòò ð, #'¨$°$¸dõ "
ôH!;ôFð $(Ø8<ô97òv2ð :>ô4ô"5ô25ô25ð0A¸tØ¨4°tÀ4öAð@FP°dÀØ!¨°4öFPðPFP°dÀØ!¨°4öFPðPFP°dÀØ!¨°4öFPðP €JØ€JØ€Jò0ò0ò0ñ, & g¨{Ó;€Jñ & gÐ/@ÓA€JÙ% gÐ/@ÓA€JÙ% gÐ/@ÓA€JÙADð	÷ ‰FÚóBÑ>€JÔ˜
Ô*¨JÔ,>ñ  & g¨~Ó>€JÙ% g¨{Ó;€JÙ/°Ð9NÓOÐÙ/°Ð9NÓOÐÙ*¨7Ð4DÓE€OÙ*ØÐ!Ø!Ð#6Ð7ñ9€Oñ & g¨{Ó;€JØ××Ø×Ò˜hŸošoð /ó ñ 	Õòð HKØôK.ôZ(ð: ;@ñ;Ø(ð;Ø37ð;à	�‰õ;ò$9ôv:ò*@òòò/ò&@õ"/ò$LòHò-òòôò"òò ô#ðJ˜%ð  Eð ¨b¯j©jô òB\6ò|"9òHð, 37Ø:?ô.4ò`$>òLIò.&ôEò ð €LØ€Lô÷ .ò<.ñ *¨'°>ÓB€Nò ð ¸÷ ñ ð: €FØ�Y‰Y€Fà'*°u÷ *ð *ðX €Fð   f¸ÀTØ %õðB -1°tØ¨D¸UõEðN 5:õ zðx )-°4¸dÈØ!%°%õdôLð: DHØô	'ð6È%ö 6ôñ. Óà q¨s¸4ÈE÷(ó ð(ðT €IáÓà!¨!°#¸dÈu÷7ó ð7òr/ñ Óà $°5÷"ó ð"ðH €JáÓØ&)°$À5÷ 2ó ð2ðhAØ$)÷Añ AñF ò %<ñ =ð :>ðNà ÷Nð Nó=ðNð` €IáÓð9Ø÷9ð 9ó ð9ñv ÓØ/3Ø7;ðeàõeó ðe÷Nñ Óà¨B°fÈØô}ó ð}ð~ €Hà'+¸ÀDØ¨EõUñn Ò$KÑLØEGØHLØEJØFKØ!ó	J,ó MðJ,ðX
-ÀØ)-¸u÷-ñ -ñ  ÓØ',¸ÀuØ˜T¨s¸uôxó ðxðt †Fro   r   c                 ó’  • [         R                  " SSU 5      =p[         R                  " X5      u  p4[         R                  " US-  US-  -   * S-  5      S[         R                  -  -  n[         R                  " US-
  S-  S-  US-
  S-  S-  -   * S-  5      S[         R                  -  S-  S-  -  nXe-
  nUS-  nUS-  nUS-  nX4U4$ )	z,Return a tuple X, Y, Z with a test data set.g      Àg      @r²   r   g      ø?ræ  rÎ  iô  )r·   r_  ÚmeshgridÚexpr¹  )ro  r   r   rY  rZ  ÚZ1ÚZ2r[  s           rm   Úget_test_datarE  ¼  sÎ   € ä�IŠI�d˜C Ó'Ð'€AÜ�;Š;�qÓ�D€Aä	�Š�!�Q‘$˜˜A™‘+� Ñ"Ó	# q¬2¯5©5¡yÑ	1€BÜ
�&Š&�Q˜‘U˜c‘M AÑ%¨!¨a©%°3©¸Ñ(:Ñ:Ð;¸aÑ?Ó
@ØŒr�u‰u‰9�s‰?˜SÑ ñ"€Bà
‰€Aà	ˆB‰€AØ	ˆB‰€AØ	ˆC‰€AØ�ˆ7€Nro   c                   óŽ   • \ rS rSrSrS rS rS rS r\	S 5       r
S rS	 rS
 r\rS rS rS r\S 5       r\S 5       rS rSrg)r“  iÌ  zV
Quaternions
consisting of scalar, along 1, and vector, with components along i, j, k
c                 óF   • Xl         [        R                  " U5      U l        g rû   )Úscalarr·   r¸   Úvector)re   rH  rI  s      rm   rK   Ú_Quaternion.__init__Ò  s   € ØŒÜ—h’h˜vÓ&ˆ�ro   c                 óR   • U R                  U R                  * U R                  * 5      $ rû   ©rl   rH  rI  rt   s    rm   Ú__neg__Ú_Quaternion.__neg__Ö  s   € Ø�~‰~˜tŸ{™{˜l¨T¯[©[¨LÓ9Ð9ro   c                 óf  • U R                  U R                  UR                  -  [        R                  " U R                  UR                  5      -
  U R                  UR                  -  U R                  UR                  -  -   [        R
                  " U R                  UR                  5      -   5      $ )zÔ
Product of two quaternions
i*i = j*j = k*k = i*j*k = -1
Quaternion multiplication can be expressed concisely
using scalar and vector parts,
see <https://en.wikipedia.org/wiki/Quaternion#Scalar_and_vector_parts>
)rl   rH  r·   rò  rI  Úcross©re   r  s     rm   Ú__mul__Ú_Quaternion.__mul__Ù  sz   € ð �~‰~Ø�K‰K˜Ÿ™Ñ$¤r§v¢v¨d¯k©k¸5¿<¹<Ó'HÑHØ�K‰K˜Ÿ™Ñ$ t§{¡{°5·<±<Ñ'?Ñ?Ü�hŠh�t—{‘{ E§L¡LÓ1ñ2ó3ð 	3ro   c                 óP   • U R                  U R                  U R                  * 5      $ )z5The conjugate quaternion -(1/2)*(q+i*q*i+j*q*j+k*q*k)rL  rt   s    rm   Ú	conjugateÚ_Quaternion.conjugateæ  s   € à�~‰~˜dŸk™k¨D¯K©K¨<Ó8Ð8ro   c                 óŒ   • U R                   U R                   -  [        R                  " U R                  U R                  5      -   $ )zThe 2-norm, q*q', a scalar)rH  r·   rò  rI  rt   s    rm   rÄ   Ú_Quaternion.normê  s/   € ð �{‰{˜4Ÿ;™;Ñ&¬¯ª°·±¸T¿[¹[Ó)IÑIÐIro   c                 óš   • [         R                  " U R                  5      nU R                  U R                  U-  U R
                  U-  5      $ )zScaling such that norm equals 1)r·   rƒ  rÄ   rl   rH  rI  ©re   rZ  s     rm   r  Ú_Quaternion.normalizeï  s5   € ä�GŠG�D—I‘IÓˆØ�~‰~˜dŸk™k¨!™m¨T¯[©[¸©]Ó;Ð;ro   c                 ót   • U R                   nU R                  U R                  U-  U R                  * U-  5      $ )z.The reciprocal, 1/q = q'/(q*q') = q' / norm(q))rÄ   rl   rH  rI  rZ  s     rm   Ú
reciprocalÚ_Quaternion.reciprocalô  s.   € à�I‰IˆØ�~‰~˜dŸk™k¨!™m¨d¯k©k¨\¸!©^Ó<Ð<ro   c                 ó&   • XR                  5       -  $ rû   )r]  rQ  s     rm   Ú__div__Ú_Quaternion.__div__ù  s   € Ø×$Ñ$Ó&Ñ&Ð&ro   c                 óL   • U R                  SU5      nX-  U -  nUR                  $ )Nr   )rl   rI  )re   rý  s     rm   ÚrotateÚ_Quaternion.rotateþ  s(   € ð �N‰N˜1˜aÓ ˆØ‰F�4‰KˆØ�x‰xˆro   c                 óˆ   • U R                   UR                   :H  =(       a#    U R                  UR                  :H  R                  $ rû   )rH  rI  rV  rQ  s     rm   Ú__eq__Ú_Quaternion.__eq__  s-   € Ø—‘˜uŸ|™|Ñ+×R°$·+±+ÀÇÁÑ2M×1RÑ1RÐRro   c                 ór   • SR                  [        U R                  5      [        U R                  5      5      $ )Nz_Quaternion({}, {}))r*  ÚreprrH  rI  rt   s    rm   Ú__repr__Ú_Quaternion.__repr__  s'   € Ø$×+Ñ+¬D°·±Ó,=¼tÀDÇKÁKÓ?PÓQÐQro   c                 ó®  • [         R                  " X5      n[         R                  R                  U5      n[         R                  " U[         R
                  " X5      5      nUS-  nUS:X  a²  [         R
                  " X5      S:  aŠ  [        R                  " S5        [         R                  " S5      nSU[         R                  " X-  5      '   [         R                  " X5      nU[         R                  R                  U5      -  nU " SU5      nU$ U " S/ SQ5      n U$ U " [         R                  " U5      U[         R                  " U5      -  U-  5      nU$ )zç
The quaternion for the shortest rotation from vector r1 to vector r2
i.e., q = sqrt(r2*r1'), normalized.
If r1 and r2 are antiparallel, then the result is ambiguous;
a normal vector will be returned, and a warning will be issued.
r²   r   z6Rotation defined by anti-parallel vectors is ambiguousrØ   r   r  )r·   rP  rÃ   rÄ   Úarctan2rò  ÚwarningsÚwarnrw  ry  ré  rê  )Úclsrn  r†  r£  r¤  r¥  r¢  s          rm   r•  Ú_Quaternion.rotate_from_to  s  € ô �HŠH�RÓˆÜ�Y‰Y�^‰^˜AÓˆÜ�ZŠZ˜œBŸFšF 2›NÓ+ˆØ
ˆa‰ˆØ�‹7Ü�vŠv�b‹~ Ó!Ü—’ÐVÔWÜ—H’H˜Q“K�Ø&'�”"—)’)˜B™EÓ"Ñ#Ü—H’H˜R“O�ØœŸ	™	Ÿ™ qÓ)Ñ)�Ù˜˜1“I�ð
 ˆñ ˜š9Ó%‘ð ˆñ ”B—F’F˜2“J ¤"§&¢&¨£*¡¨R¡Ó0ˆAØˆro   c                 ó´  • [         R                  " US-  5      [         R                  " US-  5      pT[         R                  " US-  5      [         R                  " US-  5      pv[         R                  " US-  5      [         R                  " US-  5      p˜XF-  U-  XW-  U	-  -   n
XF-  U	-  XW-  U-  -
  nXG-  U-  XV-  U	-  -   nXG-  U	-  XV-  U-  -
  nU " X«XÍ/5      $ )zÔ
Converts the angles to a quaternion
    q = exp((roll/2)*e_x)*exp((elev/2)*e_y)*exp((-azim/2)*e_z)
i.e., the angles are a kind of Tait-Bryan angles, -z,y',x".
The angles should be given in radians, not degrees.
r²   )r·   ré  rê  )rp  r"   r#   r$   ÚcaÚsaÚceÚseÚcrÚsrÚqwÚqxÚqyÚqzs                 rm   r”  Ú_Quaternion.from_cardan_angles%  sÈ   € ô —’˜˜Q™“¤§¢¨¨Q©£ˆBÜ—’˜˜Q™“¤§¢¨¨Q©£ˆBÜ—’˜˜Q™“¤§¢¨¨Q©£ˆBà‰U�2‰X˜™˜b™Ñ ˆØ‰U�2‰X˜™˜b™Ñ ˆØ‰U�2‰X˜™˜b™Ñ ˆØ‰U�2‰X˜™˜b™Ñ ˆÙ�2˜B�|Ó$Ð$ro   c                 ó®  • U R                   nU R                  SSS24   u  p#n[        R                  " SU* U-  X#-  -   -  X-  X"-  -   X3-  -
  XD-  -
  5      n[        R                  " [        R
                  " SX-  XB-  -   -  X-  X"-  -   X3-  -   XD-  -   -  SS5      5      n[        R                  " SX-  X4-  -
  -  X-  X"-  -
  X3-  -
  XD-  -   5      nXeU4$ )zœ
The inverse of `from_cardan_angles()`.
Note that the angles returned are in radians, not degrees.
The angles are not sensitive to the quaternion's norm().
.Nr²   râ  r   )rH  rI  r·   rm  ÚarcsinrÂ  )re   ry  rz  r{  r|  r#   r"   r$   s           rm   r—  Ú_Quaternion.as_cardan_angles7  sÚ   € ð �[‰[ˆØ—[‘[ ¢a Ñ(‰
ˆ�Ü�zŠz˜!˜b˜S ™V B¡E™\Ñ*¨B©E°"±%©K¸¹Ñ,=¸b¹eÑ,CÓDˆÜ�yŠyœŸš  B¡E¨"©%¡K¡°"±%¸¹±+¸b¹eÑ2CÀBÁEÑ2IÑ!JÈBÐPQÓRÓSˆÜ�zŠz˜!˜R™U 2¡5™[™/¨2©5°±©;°r±uÑ+<¸R¹UÑ+BÓCˆØ˜4ÐÐro   )rH  rI  N)r  r  r  r  r   rK   rM  rR  rU  ÚpropertyrÄ   r  r]  r`  Ú__truediv__rc  rf  rj  Úclassmethodr•  r”  r—  r>  rÓ   ro   rm   r“  r“  Ì  s…   † ñò
'ò:ò3ò9ð ñJó ðJò<ò
=ò
'ð €KòòSòRð ñó ðð2 ñ%ó ð%õ" ro   r“  )rì  )7r   Úcollectionsr   rQ  r"  r2  rn  Únumpyr·   Ú
matplotlibrž  r   r   r   r   Úmatplotlib.artistr  rö  Úmatplotlib.collectionsrý   Úmatplotlib.colorsr   r  Úmatplotlib.imageÚimagera  Úmatplotlib.linesr  rc  Úmatplotlib.patchesró  rÿ   r  Ú	containerr¾  Úmatplotlib.transformsÚ
transformsrè   Úmatplotlib.axesr   Úmatplotlib.axes._baser	   r
   r   Úmatplotlib.tri._triangulationr   rM  r   r   r   ÚinterpdÚdefine_aliasesr   rE  r“  rÓ   ro   rm   Ú<module>r–     s³   ðñ
õ $Û Û Û Û ã ã ß @Ó @Ý #Ý &Ý #Ý !Ý !Ý %Ý )Ý +Ý  ß LÝ &Ý 7å Ý Ý ð ×ÑØ×ÒØˆJ  
°X°Jñ@ó AôM>ˆTó M>óAó ðM>ô`|÷ v ò v ro   