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

1678 lines
189 KiB
Plaintext
Raw Normal View History

Ë
†RjÆTãó&—dZddlmZddlZddlZddlmZmZddlmZddl Z
ddl Z ddl
mZmZmZmZmZmZmZmZmZddlmZdd lmZmZmZdd
lmZmZGd „d «Z Gd
„d«Z!Gd„de!«Z"Gd„de"«Z#Gd„de"«Z$Gd„de$«Z%Gd„de$«Z&d„Z'Gd„de"«Z(Gd„de"«Z)Gd„de"«Z*Gd „d!e!«Z+Gd"„d#e"«Z,Gd$„d%e!«Z-Gd&„d'e"«Z.Gd(„d)e.«Z/Gd*„d+«Z0Gd,„d-«Z1d.Z2ejfe2jid/d0««Gd1„d2e.««Z5ejfe2jid/d3««Gd4„d5e5««Z6Gd6„d7e.«Z7Gd8„d9e.«Z8Gd:„d;e"«Z9y)<a|
GUI neutral widgets
===================
Widgets that are designed to work for any of the GUI backends.
All of these widgets require you to predefine an `~.axes.Axes`
instance and pass that as the first parameter. Matplotlib doesn't try to
be too smart with respect to layout -- you will have to figure out how
wide and tall you want your Axes to be to accommodate your widget.
é)Ú ExitStackN)ÚIntegralÚNumber)Úcycleré) Ú_apiÚ
_docstringÚ
backend_toolsÚcbookÚ collectionsÚcolorsÚtextÚtickerÚ
transforms)ÚLine2D)Ú RectangleÚEllipseÚPolygon)ÚTransformedPatchPathÚAffine2Dcó4—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z y) ÚLockDrawa®
Some widgets, like the cursor, draw onto the canvas, and this is not
desirable under all circumstances, like when the toolbar is in zoom-to-rect
mode and drawing a rectangle. To avoid this, a widget can acquire a
canvas' lock with ``canvas.widgetlock(widget)`` before drawing on the
canvas; this will prevent other widgets from doing so at the same time (if
they also try to acquire the lock first).
có—d|_y©N©Ú_owner©Úselfs úU/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/widgets.pyÚ__init__zLockDraw.__init__&s €Øˆ� ócóJ—|j|«s td«‚||_y)zReserve the lock for *o*.zalready lockedN©Ú availableÚ
ValueErrorr©rÚos rÚ__call__zLockDraw.__call__)s!€à�~‰~˜aÔ ÜÐ-Ó.Ð .؈� r!cóJ—|j|«s td«‚d|_y)zRelease the lock from *o*.zyou do not own this lockNr#r&s rÚreleasezLockDraw.release/s!€à�~‰~˜aÔ ÜÐ7Ó8Ð 8؈� r!cóJ—|j« xs|j|«S)z+Return whether drawing is available to *o*.)ÚlockedÚisownerr&s rr$zLockDraw.available5s€à—;‘;“=Ð Ò3 D§L¡L°£OÐ3r!có—|j|uS)z"Return whether *o* owns this lock.rr&s rr-zLockDraw.isowner9s€à�{‰{˜aÐÐr!có—|jduS)z6Return whether the lock is currently held by an owner.Nrrs rr,zLockDraw.locked=s€à�{‰{ $Ð&Ð&r!N)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__r r(r*r$r-r,©r!rrrs%„ñòòò ò 4ò ó'r!rcóD—eZdZdZdZdZdZd„Zd„Ze eed¬«Z
d„Z y) ÚWidgetz6
Abstract base class for GUI neutral widgets.
Tcó—||_y)z!Set whether the widget is active.N©Ú_active)rÚactives rÚ
set_activezWidget.set_activeJs €àˆ� r!có—|jS)z!Get whether the widget is active.r8rs rÚ
get_activezWidget.get_activeNs €à�|‰|Ðr!zIs the widget active?)Údoccó—|j S)z‰
Return whether *event* should be ignored.
This method should be called at the beginning of any event callback.
)r:©rÚevents rÚignorez
Widget.ignoreUs€ð —;‘;ˆÐr!N) r0r1r2r3ÚdrawonÚeventsonr9r;r=Úpropertyr:rBr4r!rr6r6Bs8„ñð€FØ€HØ€Gòòñ
�j *Ð2IÔ
J€Fór!r6có:—eZdZdZd„Zed„«Zd„Zd„Zd„Z y)Ú
AxesWidgetaõ
Widget connected to a single `~matplotlib.axes.Axes`.
To guarantee that the widget remains responsive and not garbage-collected,
a reference to the object should be maintained by the user.
This is necessary because the callback registry
maintains only weak-refs to the functions, which are member
functions of the widget. If there are no references to the widget
object it may be garbage collected which will disconnect the callbacks.
Attributes
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
canvas : `~matplotlib.backend_bases.FigureCanvasBase`
The parent figure canvas for the widget.
active : bool
If False, the widget does not respond to events.
có —||_g|_yr)ÚaxÚ_cids)rrIs rr zAxesWidget.__init__ts€ØˆŒØˆ�
r!cóN—|jjd¬«jS)NT©Úroot)rIÚ
get_figureÚcanvasrs rú<lambda>zAxesWidget.<lambda>xs€ 4§7¡7×#5Ñ#5¸4Ð#5Ó#@×#GÑ#G€r!cór—|jj||«}|jj|«y)zÆ
Connect a callback function with an event.
This should be used in lieu of ``figure.canvas.mpl_connect`` since this
function stores callback ids for later clean up.
N)rOÚ mpl_connectrJÚappend)rrAÚcallbackÚcids rÚ
connect_eventzAxesWidget.connect_eventzs,€ð�k‰k×%Ñ% e¨XÓ6ˆØ �
‰
×ј#Õr!có\—|jD]}|jj|«Œy)z-Disconnect all events created by this widget.N)rJrOÚmpl_disconnect)rÚcs rÚdisconnect_eventszAxesWidget.disconnect_events„s'€à—‘ò *ˆAØ �K‰K× &Ñ & qÕ )ñ *r!cóô—|j|jur|j|jfS|jjj «j
|j|jf«S)z8Return *event*'s data coordinates in this widget's Axes.) ÚinaxesrIÚxdataÚydataÚ transDataÚinvertedÚ transformÚxÚyr@s rÚ_get_data_coordszAxesWidget._get_data_coords‰s]€ð/4¯l©l¸d¿g¹gÑ.E�—‘˜eŸk™kÐ*ð QØ—W‘W×&Ñ&×/Ñ/Ó1×;Ñ;¸U¿W¹WÀeÇgÁgÐ<NÓOð Qr!N)
r0r1r2r3r rErOrVrZrdr4r!rrGrG^s)„ñò*ñÑGÓ
H€Fòò*ó
Qr!rGcóL‡—eZdZdZ d
ddœˆfd„ Zd„Zd„Zd„Zd„Zd „Z ˆxZ
S) ÚButtona”
A GUI neutral button.
For the button to remain responsive you must keep a reference to it.
Call `.on_clicked` to connect to the button.
Attributes
----------
ax
The `~.axes.Axes` the button renders into.
label
A `.Text` instance.
color
The color of the button when not hovering.
hovercolor
The color of the button when hovering.
T)ÚuseblitcóX•—t‰|�|«|�|j|«|jdd|dd|j¬«|_|xr|j j|_tjdg¬«|_ |jd|j«|jd|j«|jd |j«|j!d
«|j#|«|j%g«|j'g«||_||_y) a
Parameters
----------
ax : `~matplotlib.axes.Axes`
The `~.axes.Axes` instance the button will be placed into.
label : str
The button text.
image : array-like or PIL Image
The image to place in the button, if not *None*. The parameter is
directly forwarded to `~.axes.Axes.imshow`.
color : :mpltype:`color`
The color of the button when not activated.
hovercolor : :mpltype:`color`
The color of the button when the mouse is over it.
useblit : bool, default: True
Use blitting for faster drawing if supported by the backend.
See the tutorial :ref:`blitting` for details.
.. versionadded:: 3.7
Nçà?Úcenter)ÚverticalalignmentÚhorizontalalignmentraÚclicked©ÚsignalsÚbutton_press_eventÚbutton_release_eventÚmotion_notify_eventF)Úsuperr ÚimshowrÚ transAxesÚlabelrOÚ
supports_blitÚ_useblitr ÚCallbackRegistryÚ
_observersrVÚ_clickÚ_releaseÚ_motionÚ set_navigateÚ
set_facecolorÚ
set_xticksÚ
set_yticksÚcolorÚ
hovercolor)rrIrvÚimager‚rƒrgÚ __class__s €rr zButton.__init__§s÷ø€ô, ‰Ñ˜Ôà Ð Ø �I‰I�eÔ Ø—W‘W˜S # uØ/7Ø19Ø')§|¡|ðó5ˆŒ
ð
 Ò= D§K¡K×$=Ñ$=ˆŒ
ä×0Ñ0¸)¸ÔEˆŒà ×ÑÐ/°·±Ô=Ø ×ÑÐ1°4·=±=ÔAØ ×ÑÐ0°$·,±,Ô?Ø
�‰˜ÔØ
×Ñ˜ÔØ
�
‰
�bÔØ
�
‰
�bÔØˆŒ
Ø$ˆ�r!có—|jr/|j|«s|jj|«dsy|jj
|jk7r&|jj
|j«yy©Nr)rDrBrIÚcontainsrOÚ
mouse_grabberÚ
grab_mouser@s rr{z
Button._clickÔs_€Ø�}Š} § ¡ ¨EÔ 2¸$¿'¹'×:JÑ:JÈ5Ó:QÐRSÒ:TØ Ø �<‰<× %Ñ %¨¯©Ò 0Ø �L‰L× #Ñ # D§G¡GÕ ,ð 1r!cóH—|j|«s#|jj|jk7ry|jj |j«|j
r<|jj
|«dr|jjd|«yyy)Nrrm) rBrOr‰rIÚ
release_mouserDrˆrzÚprocessr@s rr|zButton._releaseÚst€Ø �;‰;�uÔ  §¡×!;Ñ!;¸t¿w¹wÒ!FØ Ø
� ‰ ×"Ñ" 4§7¡7Ô+Ø �=Š=˜TŸW™W×-Ñ-¨eÓ4°QÒ7Ø �O‰O× #Ñ # I¨uÕ 5ð8ˆ=r!có8—|j|«ry|jj|«dr |jn |j}t j ||jj««s¤|jj|«|jr||jrU|jj|j«|jj|jj«y|jj«yyyr‡)rBrIrˆrƒr‚r
Ú
same_colorÚ
get_facecolorrrCrxÚ draw_artistrOÚblitÚbboxÚdraw©rrArYs rr}zButton._motionás½€Ø �;‰;�uÔ Ø Ø#Ÿw™w×/Ñ/°Ó6°qÒ9ˆD�OŠO¸t¿z¹zˆÜ× Ñ   D§G¡G×$9Ñ$9Ó$;Ô<Ø �G‰G× !Ñ ! !Ô $Ø�{Š{Ø—=’=Ø—G‘G×'Ñ'¨¯©Ô0Ø—K‘K×$Ñ$ T§W¡W§\¡\Õ2à—K‘K×$Ñ$Õ&ð ð=r!cóB‡—|jjdˆfd„«S)zž
Connect the callback function *func* to button click events.
Returns a connection id, which can be used to disconnect the callback.
rmcó•—‰|«Srr4)rAÚfuncs €rrPz#Button.on_clicked.<locals>.<lambda>ôs ø€ÁÀUà €r!©rzÚconnect©rr˜s `rÚ
on_clickedzButton.on_clickedîsø€ð �‰×&Ñ& yÓ2KÓLÐLr!có:—|jj|«y)z6Remove the callback function with connection id *cid*.N©rzÚ
disconnect©rrUs rrŸzButton.disconnectöó€à �‰×"Ñ" 3Õ'r!)Nz0.85z0.95) r0r1r2r3r r{r|r}rœrŸÚ
__classcell__©r…s@rrfrf”s8ø„ñð$)-Ø*0ð+%Ø=Aö+%òZ-ò 6ò 'òMö(r!rfcó4‡—eZdZdZˆfd„Zd„Zd„Zd„ZˆxZS)Ú
SliderBasezª
The base class for constructing Slider widgets. Not intended for direct
usage.
For the slider to remain responsive you must maintain a reference to it.
c
óî•—|jdk(r td«‚t‰ |�
|«t j
ddg|¬«||_||_||_||_ ||_
| |_ d|_ ||_
|dk(r |j||f«|j}
n|j!||f«|j"}
|
j%«|_t)|j&t*j,«s4t+j,«|_|j&j/|
«|j&j1d«|j&j3d«|j5«|j7d«|j9d|j:«|j9d |j:«|r|j9d
|j:«t=j>d g¬ «|_ y)
NÚ3dz"Sliders cannot be added to 3D AxesÚ
horizontalÚvertical)Ú orientationFTrprqrrÚchangedrn)!Únamer%rsr rÚ
check_in_listrªÚ closedminÚ closedmaxÚvalminÚvalmaxÚvalstepÚ drag_activeÚvalfmtÚset_ylimÚyaxisÚset_xlimÚxaxisÚget_major_formatterÚ_fmtÚ
isinstancerÚScalarFormatterÚset_axisÚ
set_useOffsetÚset_useMathTextÚ set_axis_offr~rVÚ_updater ryrz) rrIrªr®r¯r°r±r´Údraggingr²Úaxisr…s €rr zSliderBase.__init__sˆø€à
�7‰7�dŠ?ÜÐAÓBÐ Bä
‰Ñ˜ÔÜ ×јL¨*Ð5À;ÕOà&ˆÔØ"ˆŒØ"ˆŒØˆŒ ؈Œ ؈Œ Ø ˆÔ؈Œ à ˜*Ò $Ø �K‰K˜ Ð(Ô )Ø—8‘8‰Dà �K‰K˜ Ð(Ô )Ø—8‘8ˆDà×,Ñ,Ó.ˆŒ ܘ$Ÿ)™)¤V×%;Ñ%;Ô<Ü×.Ñ.Ó0ˆDŒIØ �I‰I× Ñ ˜tÔ $Ø � ‰ ×Ñ Ô&Ø � ‰ ×!Ñ! $Ô'à
�‰ÔØ
�‰˜Ôà ×ÑÐ/°·±Ô>Ø ×ÑÐ1°4·<±<Ô@Ù Ø × Ñ Ð4°d·l±lÔ CÜ×0Ñ0¸)¸ÔEˆ�r!có¼—t|jt«rA|jt ||jz
|jz «|jzz}|S|j�tt j |j«}|jdk7rtd|j›�«‚|t jt j||z
««}|S)z?Return *val* coerced to closest number in the ``valstep`` grid.rz&valstep must have 1 dimension but has ) r»r²rr°ÚroundÚnpÚ
asanyarrayÚndimr%ÚargminÚabs)rÚvalr²s rÚ_stepped_valuezSliderBase._stepped_value*sµ€ä �d—l‘l¤FÔ +Ø—;‘;ܘC $§+¡+Ñ-°·±Ñ=Ó>ÀÇÁÑMñNˆCðˆ
ð�\‰\Ð
%Ü—m‘m D§L¡LÓ1ˆGØ�|‰|˜qÒ Ü Ø<¸W¿\¹\¸NÐKóððœ"Ÿ)™)¤B§F¡F¨7°S©=Ó$9Ó:Ñ;ˆC؈
r!có:—|jj|«y)z±
Remove the observer with connection id *cid*.
Parameters
----------
cid : int
Connection id of the observer to be removed.
Nržr s rrŸzSliderBase.disconnect8s€ð
�‰×"Ñ" 3Õ'r!có”—tj|j|jk7«r|j |j«yy)z&Reset the slider to the initial value.N)rÆÚanyrËÚvalinitÚset_valrs rÚresetzSliderBase.resetCs0€ä
�6‰6�$—(‘(˜dŸl™lÑ*Ô +Ø �L‰L˜Ÿ™Õ &ð ,r!) r0r1r2r3r rÌrŸrÒr¢r£s@rr¥r¥ûsø„ñô &FòP ò (ö'r!r¥c
ó\‡—eZdZdZdddddddddddddœ ˆfd „
Zd
„Zd „Zd „Zd
„Zd„Z ˆxZ
S)ÚSlideraB
A slider representing a floating point range.
Create a slider from *valmin* to *valmax* in Axes *ax*. For the slider to
remain responsive you must maintain a reference to it. Call
:meth:`on_changed` to connect to the slider event.
Attributes
----------
val : float
Slider value.
riNTr¨ÚrÚ lightgrey) rÐr´r®r¯Ú sliderminÚ slidermaxrÂr²rªÚ initcolorÚ track_colorÚ handle_stylec 󸕗t‰|�||
|||||| | « | �$t| d«stdt | «›d�«‚|
�$t|
d«stdt |
«›d�«‚| |_|
|_|j|«}|€|}||_||_ dddd œ}|€in|}i|¥|¥j«D��cic] \}}d
|›�|“Œ
}}}|
d k(r‹td d
d|j|¬«|_
|j|j«|j||ddfi|¤Ž|_|j#|dd|dt%|j«¬«|_d
g|gg}nŠtddd
|j|¬«|_
|j|j«|j(||ddfi|¤Ž|_|j+|dd|dt%|j«¬«|_|gd
gg}|j.g|¢d‘­i|¤ddi¤Ž\|_|
d k(r\|j3d
d||jdd¬«|_|j3d
d|j7|«|jdd¬«|_n[|j3dd
||jdd¬«|_|j3dd
|j7|«|jdd¬«|_|j;|«ycc}}w) ah
Parameters
----------
ax : Axes
The Axes to put the slider in.
label : str
Slider label.
valmin : float
The minimum value of the slider.
valmax : float
The maximum value of the slider.
valinit : float, default: 0.5
The slider initial position.
valfmt : str, default: None
%-format string used to format the slider value. If None, a
`.ScalarFormatter` is used instead.
closedmin : bool, default: True
Whether the slider interval is closed on the bottom.
closedmax : bool, default: True
Whether the slider interval is closed on the top.
slidermin : Slider, default: None
Do not allow the current slider to have a value less than
the value of the Slider *slidermin*.
slidermax : Slider, default: None
Do not allow the current slider to have a value greater than
the value of the Slider *slidermax*.
dragging : bool, default: True
If True the slider can be dragged by the mouse.
valstep : float or array-like, default: None
If a float, the slider will snap to multiples of *valstep*.
If an array the slider will snap to the values in the array.
orientation : {'horizontal', 'vertical'}, default: 'horizontal'
The orientation of the slider.
initcolor : :mpltype:`color`, default: 'r'
The color of the line at the *valinit* position. Set to ``'none'``
for no line.
track_color : :mpltype:`color`, default: 'lightgrey'
The color of the background track. The track is accessible for
further styling via the *track* attribute.
handle_style : dict
Properties of the slider handle. Default values are
========= ===== ======= ========================================
Key Value Default Description
========= ===== ======= ========================================
facecolor color 'white' The facecolor of the slider handle.
edgecolor color '.75' The edgecolor of the slider handle.
size int 10 The size of the slider handle in points.
========= ===== ======= ========================================
Other values will be transformed as marker{foo} and passed to the
`~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
result in ``markerstyle = 'x'``.
Notes
-----
Additional kwargs are passed on to ``self.poly`` which is the
`~matplotlib.patches.Rectangle` that draws the slider knob. See the
`.Rectangle` documentation for valid property names (``facecolor``,
``edgecolor``, ``alpha``, etc.).
NrËzArgument slidermin (z) has no 'val'zArgument slidermax (Úwhiteú.75é
©Ú facecolorÚ edgecolorÚsizeÚmarkerr©©çÐ?rrir©raráræçè?r)r‚ÚlwÚ clip_path©rrær'Úclip_onFçR¸…ëQð?Úbottomrj©rarkrlç{®Gáz”¿ÚtopÚrightÚleft)rsr Úhasattrr%Útyper×rØÚ_value_in_boundsrËrÐÚitemsrruÚtrackÚ add_patchÚaxhspanÚpolyÚaxhlinerÚhlineÚaxvspanÚaxvlineÚvlineÚplotÚ_handlerrvÚ_formatÚvaltextrÑ)rrIrvr°r±rÐr´r®r¯r×rØrÂr²rªrÙrÚrÛÚkwargsÚdefaultsÚkÚvÚ marker_propsÚhandleXYr…s €rr zSlider.__init__Ws5ø€ôb ‰Ñ˜˜[¨)°YØ ¨°¸7ô Dð Ð ¬°¸EÔ)BÜØ&¤t¨I£Ð&7°~ÐFóHð
Hà Ð ¬°¸EÔ)BÜØ&¤t¨I£Ð&7°~ÐFóHð
Hà"ˆŒØ"ˆŒØ×'Ñ'¨Ó0ˆØ ˆ?؈G؈ŒØˆŒ à!(°uÀbÑIˆØ)Ð1‘r°|ˆ à(D¨8Ð(D°|Ð(D×(JÑ(JÓ(L÷
Ù $  1ˆf�Q�CˆL˜!‰Oð
ˆ ñ
ð ˜*Ò $Ü"ؘ"˜aØŸ,™,Ø%ôˆDŒJð
�L‰L˜Ÿ™Ô $Ø"˜Ÿ
™
 6¨7°C¸ÑGÀÑGˆDŒI🙠G¨Q°¸ÀqÜ.BÀ4Ç:Á:Ó.Nð$óPˆDŒJà˜ ˜yÐ)‰Hä"ؘ!˜RØŸ,™,Ø%ôˆDŒJð
�L‰L˜Ÿ™Ô $Ø"˜Ÿ
™
 6¨7°C¸ÑGÀÑGˆDŒIØŸ™ G¨Q°¸ÀqÜ.BÀ4Ç:Á:Ó.Nð$óPˆDŒJà ˜  C 5Ð)ˆHؘŸ™ð
Ø
ð
à ò
ðñ
ðò 
‰
ˆŒ ð ˜*Ò $ØŸ™  d¨E¸R¿\¹\Ø3;Ø5=ð!ó?ˆDŒJðŸ7™7 3¨¨t¯|©|¸GÓ/DØ-/¯\©\Ø5:Ø7?ð#óAˆD�Lð
Ÿ™ ¨¨U¸b¿l¹lØ3;Ø5<ð!ó>ˆDŒJðŸ7™7 4¨¨d¯l©l¸7Ó.CØ-/¯\©\Ø5=Ø7=ð#ó?ˆDŒLð
� ‰ �WÕùóm
sÂ9Kcóê—|j|«}||jkr|jsy|j}n(||jk\r|jsy|j}|j
�<||j
j kr#|jsy|j
j }|j�<||jj k\r#|jsy|jj }|S)z&Makes sure *val* is with given bounds.N)rÌr°r®r±r¯r×rËrØ©rrËs rrözSlider._value_in_boundsós½€à×!Ñ! #Ó&ˆà �$—+‘+Ò Ø—>’>ØØ—+‘+‰CØ
�D—K‘KÒ
Ø—>’>ØØ—+‘+ˆCà �>‰>Ð %¨#°·±×1CÑ1CÒ*CØ—>’>ØØ—.‘.×$Ñ$ˆCà �>‰>Ð %¨#°·±×1CÑ1CÒ*CØ—>’>ØØ—.‘.×$Ñ$ˆC؈
r!có”—|j|«s|jdk7ry|jdk(rJ|jj |«dr,d|_|j j|j«|j
sy|jdk(s-|jdk(rK|jj |«ds-d|_|j j|j«y|j|«\}}|j|jdk(r|n|«}|d|jfvr|j|«yy© zUpdate the slider position.rNrprTrqFr¨)rBÚbuttonr¬rIrˆr³rOrŠrŒrdrörªrËrÑ)rrAr]r^rËs rrÁzSlider._update s€à �;‰;�uÔ  §¡°Ò!2Ø à �:‰:Ð-Ò -°$·'±'×2BÑ2BÀ5Ó2IÈ!Ò2LØ#ˆDÔ Ø �L‰L× #Ñ # D§G¡GÔ ,à×ÒØ à �J‰JÐ0Ò 0Ø—‘Ð3Ò3¸D¿G¹G×<LÑ<LÈUÓ<SÐTUÒ<VØ$ˆDÔ Ø �L‰L× &Ñ & t§w¡wÔ /Ø à×,Ñ,¨UÓ3‰ ˆˆuØ×#Ñ#Ø×%Ñ%¨Ò5‰E¸5óBˆà �t˜TŸX™XÐ&Ñ &Ø �L‰L˜Õ ð 'r!cóÞ—|j�|j|zS|jj|j||jg«\}}}||jj «zS)úPretty-print *val*.©r´rºÚ format_ticksr°r±Ú
get_offset)rrËÚ_Úss rrzSlider._format#s\€à �;‰;Ð "Ø—;‘; Ñ$Ð $à—i‘i×,Ñ,¨d¯k©k¸3ÀÇ Á Ð-LÓM‰GˆAˆq�!à�t—y‘y×+Ñ+Ó-Ñ-Ð -r!có —|jdk(rS|jj||jj«z
«|jj |g«nR|jj
||jj«z
«|jj|g«|jj|j|««|jr4|jjd¬«jj!«||_|j$r|j&j)d|«yy)zg
Set slider value to *val*.
Parameters
----------
val : float
r©TrLr«N)rªrûÚ
set_heightÚget_yrÚ set_ydataÚ set_widthÚget_xÚ set_xdatarÚset_textrrCrIrNrOÚ draw_idlerËrDrzr�r s rrÑzSlider.set_val,së€ð × Ñ ˜zÒ )Ø �I‰I× Ñ   t§y¡y§¡Ó'8Ñ!8Ô 9Ø �L‰L× "Ñ " C 5Õ )à �I‰I× Ñ   d§i¡i§o¡oÓ&7Ñ 7Ô 8Ø �L‰L× "Ñ " C 5Ô )Ø � ‰ ×јdŸl™l¨3Ó/Ô0Ø �;Š;Ø �G‰G× Ñ  DÐ Ó )× 0Ñ 0× :Ñ :Ô <؈ŒØ �=Š=Ø �O‰O× #Ñ # I¨sÕ 3ð r!cóB‡—|jjdˆfd„«S)a€
Connect *func* as callback function to changes of the slider value.
Parameters
----------
func : callable
Function to call when slider is changed.
The function must accept a single float as its arguments.
Returns
-------
int
Connection id (which can be used to disconnect *func*).
r«có•—‰|«Srr4©rËr˜s €rrPz#Slider.on_changed.<locals>.<lambda>Pó ø€¹dÀ3»i€r!r™r›s `rÚ
on_changedzSlider.on_changedAóø€ð�‰×&Ñ& yÓ2GÓHÐHr!) r0r1r2r3r rörÁrrÑr$r¢r£s@rrÔrÔIsIø„ñ ð>AÈØ¨4¸4ب$¸Ø)°SØ(°tö Zòxò0ò0.ò4ö*Ir!rÔc
óz‡—eZdZdZddddddddddœ ˆfd„
Zd„Zd „Zd
„Zd „Zd „Z d
„Z
d„Z d„Z d„Z
d„Zd„ZˆxZS)Ú RangeSlideraÑ
A slider representing a range of floating point values. Defines the min and
max of the range via the *val* attribute as a tuple of (min, max).
Create a slider that defines a range contained within [*valmin*, *valmax*]
in Axes *ax*. For the slider to remain responsive you must maintain a
reference to it. Call :meth:`on_changed` to connect to the slider event.
Attributes
----------
val : tuple of float
Slider value.
NTr¨rÖ) rÐr´r®r¯rÂr²rªrÚrÛc ót•—t‰|�|| |||||| |
« ||f|_|€)||z
}tj||dzz||dzzg«}n|j |«}||_||_ddddœ}|
€in|
}
i|¥|
¥j«D��cic] \}}d|›�|“Œ
}}}| d k(retd
d d |j| ¬
«|_
|j|j«|jjd¬«}d |dg}d |dg}ndtddd |j| ¬
«|_
|j|j«|jjd¬«}|dd g}|dd g}ttj dd g«fi|¤Ž|_|j$|Ž|j"j'|«d|j"j)«_|jj|j"«|jj-«|j.g|¢d‘­i|¤ddi¤Žd|j.g|¢d‘­i|¤ddi¤Ždg|_| d k(r\|j3d d||jdd¬«|_|j3d d|j7|«|jdd¬«|_n[|j3dd ||jdd¬«|_|j3dd |j7|«|jdd¬«|_d|_|j=|«ycc}}w) a«
Parameters
----------
ax : Axes
The Axes to put the slider in.
label : str
Slider label.
valmin : float
The minimum value of the slider.
valmax : float
The maximum value of the slider.
valinit : tuple of float or None, default: None
The initial positions of the slider. If None the initial positions
will be at the 25th and 75th percentiles of the range.
valfmt : str, default: None
%-format string used to format the slider values. If None, a
`.ScalarFormatter` is used instead.
closedmin : bool, default: True
Whether the slider interval is closed on the bottom.
closedmax : bool, default: True
Whether the slider interval is closed on the top.
dragging : bool, default: True
If True the slider can be dragged by the mouse.
valstep : float, default: None
If given, the slider will snap to multiples of *valstep*.
orientation : {'horizontal', 'vertical'}, default: 'horizontal'
The orientation of the slider.
track_color : :mpltype:`color`, default: 'lightgrey'
The color of the background track. The track is accessible for
further styling via the *track* attribute.
handle_style : dict
Properties of the slider handles. Default values are
========= ===== ======= =========================================
Key Value Default Description
========= ===== ======= =========================================
facecolor color 'white' The facecolor of the slider handles.
edgecolor color '.75' The edgecolor of the slider handles.
size int 10 The size of the slider handles in points.
========= ===== ======= =========================================
Other values will be transformed as marker{foo} and passed to the
`~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
result in ``markerstyle = 'x'``.
Notes
-----
Additional kwargs are passed on to ``self.poly`` which is the
`~matplotlib.patches.Polygon` that draws the slider knob. See the
`.Polygon` documentation for valid property names (``facecolor``,
``edgecolor``, ``alpha``, etc.).
NrærèrÝrÞrßràrär©råriérçÚgrid)Úwhichrrrëéédr'rìFrírîrjrïrðrñròró)rsr rËrÆÚarrayrörÐr÷rrurørùrIÚget_yaxis_transformÚget_xaxis_transformrÚzerosrûÚ_update_selection_polyÚ
set_transformÚget_pathÚ_interpolation_stepsÚ_request_autoscale_viewrÚ_handlesrrvrrÚ_active_handlerÑ)rrIrvr°r±rÐr´r®r¯rÂr²rªrÚrÛrÚextentrrrr Úpoly_transformÚ
handleXY_1Ú
handleXY_2r…s €rr zRangeSlider.__init__bs–ø€ôd ‰Ñ˜˜[¨)°YØ ¨°¸7ô Dð˜FÐ#ˆŒØ ˆ?à˜f‘_ˆFÜ—h‘h ¨°$©Ñ 6Ø &¨°$©Ñ 6ð 8ó9‰Gð×+Ñ+¨GÓ4ˆG؈ŒØˆŒ à!(°uÀbÑIˆØ)Ð1‘r°|ˆ à(D¨8Ð(D°|Ð(D×(JÑ(JÓ(L÷
Ù $  1ˆf�Q�CˆL˜!‰Oð
ˆ ñ
ð ˜*Ò $Ü"ؘ"˜aØŸ,™,Ø%ôˆDŒJð
�L‰L˜Ÿ™Ô $Ø!ŸW™W×8Ñ8¸vÐ8ÓFˆNؘg a™jÐ)ˆJؘg a™jÐ)‰Jä"ؘ!˜RØŸ,™,Ø%ôˆDŒJð
�L‰L˜Ÿ™Ô $Ø!ŸW™W×8Ñ8¸vÐ8ÓFˆNØ! !™* bÐ)ˆJØ! !™* bÐ)ˆJÜœBŸH™H a¨ VÓ,Ñ7°Ñ7ˆŒ Ø#ˆ×#Ñ# WÑ-Ø � ‰ ×Ñ Ô/Ø47ˆ� ‰ ×ÑÓÔ1Ø �‰×ј$Ÿ)™)Ô$Ø �‰×'Ñ'Ô)à ˆB�G‰Gð
Øð
àò
ðñ
ðò 
ð
ñ 
ð
ˆB�G‰Gð
Øð
àò
ðñ
ðò 
ð
ñ 
ð

ˆŒ
ð ˜*Ò $ØŸ™ØØØØŸ,™,Ø"*Ø$,ð
!óˆDŒJðŸ7™7ØØØ— ‘ ˜WÓ%ØŸ,™,Ø"'Ø$,ð
#óˆD�LðŸ™ØØØØŸ,™,Ø"*Ø$+ð
!óˆDŒJðŸ7™7ØØØ— ‘ ˜WÓ%ØŸ,™,Ø"*Ø$*ð
#óˆDŒLð#ˆÔØ � ‰ �WÕùóg
sÂL4cóÔ—|jj}|jdk(r"d|fx|d<|d<d|f|d<d|f|d<d|f|d<y |dfx|d<|d<|df|d<|df|d<|df|d<y )
zx
Update the vertices of the *self.poly* slider in-place
to cover the data range *vmin*, *vmax*.
r©rærérrèr)éN)rûÚxyrª)rÚvminÚvmaxÚvertss rr2z"RangeSlider._update_selection_polys™€ð— ‘ — ‘ ˆØ × Ñ ˜zÒ )Ø"% t )Ð +ˆE�!‰H�u˜Q‘xؘD�yˆE�!‰HؘD�yˆE�!‰HؘD�yˆE�!ŠHà"&¨ )Ð +ˆE�!‰H�u˜Q‘xؘS�yˆE�!‰HؘS�yˆE�!‰HؘS�yˆE�!ŠHr!cóÒ—||jkr'|js|jdS|j}||jdkDr|jd}|j|«S)z;Ensure the new min value is between valmin and self.val[1].rr)r°r®rËrÌ©rÚmins rÚ_min_in_boundszRangeSlider._min_in_bounds/sZ€à �$—+‘+Ò Ø—>’>Ø—x‘x ‘{Ð"Ø—+‘+ˆCà �—‘˜!‘Ò Ø—(‘(˜1‘+ˆCØ×"Ñ" 3Ó'Ð'r!cóÒ—||jk\r'|js|jdS|j}||jdkr|jd}|j|«S)z;Ensure the new max value is between valmax and self.val[0].rr)r±r¯rËrÌ©rÚmaxs rÚ_max_in_boundszRangeSlider._max_in_bounds:sZ€à �$—+‘+Ò Ø—>’>Ø—x‘x ‘{Ð"Ø—+‘+ˆCà �$—(‘(˜1‘+Ò Ø—(‘(˜1‘+ˆCØ×"Ñ" 3Ó'Ð'r!cóR—|j|d«|j|d«fS)z#Clip min, max values to the bounds.rr)rGrK)rÚvalss rrözRangeSlider._value_in_boundsEs+€à×#Ñ# D¨¡GÓ,¨d×.AÑ.AÀ$ÀqÁ'Ó.JÐKÐKr!có¬—tjtj|j|z
««}|dk(r#|j |«}|j |«n"|j
|«}|j|«|jrI|jdk(r|jj|g«y|jj|g«yy)z2Update the slider value based on a given position.rr©N) rÆrÉrÊrËrGÚset_minrKÚset_maxr8rªrr)rÚposÚidxrËs rÚ_update_val_from_posz RangeSlider._update_val_from_posIs¨€ä�i‰iœŸ™˜tŸx™x¨#™~Ó.Ó/ˆØ �!Š8Ø×%Ñ% cÓ*ˆCØ �L‰L˜Õ à×%Ñ% cÓ*ˆCØ �L‰L˜Ô Ø × Ò Ø×Ñ :Ò-Ø×#Ñ#×-Ñ-¨s¨eÕ4à×#Ñ#×-Ñ-¨s¨eÕ4ð r!c óæ—|j|«s|jdk7ry|jdk(rJ|jj |«dr,d|_|j j|j«|j
sy|jdk(s-|jdk(rR|jj |«ds4d|_|j j|j«d|_ y|j|«\}}tjtj|jdk(r.|jD�cgc]}|j!«d|z
‘Œc}n-|jD�cgc]}|j#«d|z
‘Œc}««}|j|}||jur||_ |j%|jdk(r|«y|«ycc}wcc}wr)rBrr¬rIrˆr³rOrŠrŒr8rdrÆrÉrÊrªr7Ú get_xdataÚ get_ydatarS)rrAr]r^ÚhÚ handle_indexÚhandles rrÁzRangeSlider._updateXs˜€à �;‰;�uÔ  §¡°Ò!2Ø à �:‰:Ð-Ò -°$·'±'×2BÑ2BÀ5Ó2IÈ!Ò2LØ#ˆDÔ Ø �L‰L× #Ñ # D§G¡GÔ ,à×ÒØ à �J‰JÐ0Ò 0Ø—‘Ð3Ò3¸D¿G¹G×<LÑ<LÈUÓ<SÐTUÒ<VØ$ˆDÔ Ø �L‰L× &Ñ & t§w¡wÔ /Ø"&ˆDÔ Ø ð×,Ñ,¨UÓ3‰ ˆˆuÜ—y‘y¤§¡à×Ñ <Ò/ð04¯}©}Ö =¨!ˆQ�[‰[‹]˜1Ñ
 Ó
%Ó =à/3¯}©}Ö =¨!ˆQ�[‰[‹]˜1Ñ
 Ó
%Ò =ó"?ó@ˆ 𗑘|Ñ,ˆð ˜×,Ñ,Ñ ,Ø"(ˆDÔ à ×!Ñ!¨4×+;Ñ+;¸|Ò+K %ÕWÐQVÕWùò
>ùâ =s ÅG) Å5G. cód—|j�)d|j|dz›d|j|dz›d�S|jj|jg|¢|j‘«\}}}}||jj «z
}||jj «z
}d|›d|›d�S)rú(rz, rú)r)rrËrÚs1Ús2s rrzRangeSlider._formatzsµ€à �;‰;Ð "Ø�t—{‘{ S¨¡VÑ+Ð,¨B¨t¯{©{¸SÀ¹VÑ/CÐ.DÀAÐFÐ FàŸ9™9×1Ñ1Ø—‘Ð0˜sÐ0 D§K¡KÐ0ó‰LˆAˆr�2�qð
�$—)‘)×&Ñ&Ó(Ñ (ˆBØ �$—)‘)×&Ñ&Ó(Ñ (ˆBà�r�d˜"˜R˜D �?Ð "r!cóD—|j||jdf«y)zx
Set the lower value of the slider to *min*.
Parameters
----------
min : float
rN©rÑrËrEs rrOzRangeSlider.set_minˆs€ð
� ‰ �c˜4Ÿ8™8 A™;Ð'Õ(r!cóD—|j|jd|f«y)zx
Set the lower value of the slider to *max*.
Parameters
----------
max : float
rNr`rIs rrPzRangeSlider.set_max’s€ð
� ‰ �d—h‘h˜q‘k 3Ð'Õ(r!có:—tj|«}tjd|¬«|j|j
f|_|j|«\}}|j||«|jdk(r?|jdj|g«|jdj|g«n>|jdj|g«|jdj|g«|jj|j||f««|j r4|j"j%d¬«j&j)«||f|_|j*r|j,j/d||f«y y )
z~
Set slider value to *val*.
Parameters
----------
val : tuple or array-like of float
)r))rËr©rrTrLr«N)rÆÚsortrÚ check_shaper°r±rËrör2rªr7rrrrrrCrIrNrOrrDrzr�)rrËrArBs rrÑzRangeSlider.set_valœsD€ô�g‰g�c‹lˆÜ ×ј 3Õ'à—K‘K §¡Ð-ˆŒØ×*Ñ*¨3Ó/‰
ˆˆdØ ×#Ñ# D¨$Ô/Ø × Ñ ˜zÒ )Ø �M‰M˜!Ñ × &Ñ &¨ vÔ .Ø �M‰M˜!Ñ × &Ñ &¨ vÕ .à �M‰M˜!Ñ × &Ñ &¨ vÔ .Ø �M‰M˜!Ñ × &Ñ &¨ vÔ .à � ‰ ×јdŸl™l¨D°$¨<Ó8Ô9à �;Š;Ø �G‰G× Ñ  DÐ Ó )× 0Ñ 0× :Ñ :Ô <ؘ$�<ˆŒØ �=Š=Ø �O‰O× #Ñ # I°°d¨|Õ <ð r!cóB‡—|jjdˆfd„«S)a„
Connect *func* as callback function to changes of the slider value.
Parameters
----------
func : callable
Function to call when slider is changed. The function
must accept a 2-tuple of floats as its argument.
Returns
-------
int
Connection id (which can be used to disconnect *func*).
r«có•—‰|«Srr4r"s €rrPz(RangeSlider.on_changed.<locals>.<lambda>Èr#r!r™r›s `rr$zRangeSlider.on_changed¹r%r!)r0r1r2r3r r2rGrKrörSrÁrrOrPrÑr$r¢r£s@rr'r'Ssgø„ñ ð*ØØØØØØ ØØövòp!ò* (ò (òLò
5ò XòD #ò)ò)ò=ö:Ir!r'có˜—tj|tj«}|rt di|¤Ž«St j i«S©Nr4)r Únormalize_kwargsÚmtextÚTextrÚ itertoolsÚrepeat©Úpropss rÚ_expand_text_propsrpËs;€Ü × "Ñ " 5¬%¯*©*Ó 5€EÙ %ˆ?Œ6‰?�E‰?Ó Ð?¬9×+;Ñ+;¸BÓ+?Ð?r!cóz‡—eZdZdZddddddœˆfd„ Zd„Zd„Zd„Zd „Zd
„Z dd „Z
d „Z d
„Z d„Z
d„Zd„Zd„ZˆxZS)Ú CheckButtonsaŸ
A GUI neutral set of check buttons.
For the check buttons to remain responsive you must keep a
reference to this object.
Connect to the CheckButtons with the `~._Buttons.on_clicked` method.
Attributes
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
labels : list of `~matplotlib.text.Text`
The text label objects of the check buttons.
NT)rgÚ label_propsÚ frame_propsÚ check_propsc ó•—t‰|�|«tjtdf|||¬«|j g«|j
g«|jd«|€dgt|«z}|xr|jj|_ d|_ tjddt|«dz«dd}t|«}t!|||«D� �
� cgc])\} }
} |j"d| |
f|j$d d
d œ| ¤Ž‘Œ+c} }
} |_tj(|j&D� cgc]} | j+«‘Œc} «dz }
|
dzdd œt-j.|t0j2«¥d
|j$dœ¥}|j5d|j7dd««|j5d|j9dd««|j:dgt|«z|fi|¤Ž|_d|
dzdœt-j.|t0j2«¥d|j$|jdœ¥}|j5d|j9dd««|j:dgt|«z|fi|¤Ž|_|jA|«|jCd|jD«|jr|jCd|jF«t-jHdg¬«|_%ycc} }
} wcc} w)a'
Add check buttons to `~.axes.Axes` instance *ax*.
Parameters
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
labels : list of str
The labels of the check buttons.
actives : list of bool, optional
The initial check states of the buttons. The list must have the
same length as *labels*. If not given, all buttons are unchecked.
useblit : bool, default: True
Use blitting for faster drawing if supported by the backend.
See the tutorial :ref:`blitting` for details.
.. versionadded:: 3.7
label_props : dict of lists, optional
Dictionary of `.Text` properties to be used for the labels. Each
dictionary value should be a list of at least a single element. If
the list is of length M, its values are cycled such that the Nth
label gets the (N mod M) property.
.. versionadded:: 3.7
frame_props : dict, optional
Dictionary of scatter `.Collection` properties to be used for the
check button frame. Defaults (label font size / 2)**2 size, black
edgecolor, no facecolor, and 1.0 linewidth.
.. versionadded:: 3.7
check_props : dict, optional
Dictionary of scatter `.Collection` properties to be used for the
check button check. Defaults to (label font size / 2)**2 size,
black color, and 1.0 linewidth.
.. versionadded:: 3.7
N)rsrtruFrrr)éÿÿÿÿrærórj©rarlrk)rÚ linewidthr)rärarár‚ÚnonerâÚblackç333333Ã?)ryrrb©räraÚanimatedrpÚ
draw_eventrmrn)&rsr rÚcheck_isinstanceÚdictr€r�r~ÚlenrOrwrxÚ _backgroundrÆÚlinspacerpÚziprruÚlabelsr.Ú get_fontsizer rir ÚPathCollectionÚ
setdefaultÚgetÚpopÚscatterÚ_framesÚ_checksÚ _init_statusrVÚ_clickedÚ_clearryrz)rrIr†ÚactivesrgrsrtruÚysrcrvrorÚ text_sizer…s €rr zCheckButtons.__init__ásÃø€ôP ‰Ñ˜Ôä ×Ñœt T˜l¸ Ø*5À;õ Pð �
‰
�bÔØ
�
‰
�bÔØ
�‰˜Ôà ˆ?Ø�g¤ F£ Ñ+ˆGàÒ= D§K¡K×$=Ñ$=ˆŒ
؈Ôä
�[‰[˜˜Aœs 6›{¨1™}Ó
-¨a°Ð
3ˆä(¨Ó5ˆ ô
$' r¨6°;Ó#?÷ AðAñ ��5˜%ð
ˆB�G‰G�D˜!˜Uð
¨b¯l©lØ(.À(ñ
àó
ôAˆŒ ô
—H‘H¸d¿k¹kÖJ°d˜d×/Ñ/Õ1ÒJÓKÈaÑOˆ ð˜A‘Øñ
ô×$Ñ$ [´+×2LÑ2LÓMð
ðØŸ™ò 
ˆ ð ×ј{¨K¯O©O¸GÀVÓ,LÔMØ×ј{¨K¯O©O¸GÀWÓ,MÔNØ!�r—z‘z 4 &¬3¨r«7Ñ"2°BÑF¸+ÑFˆŒ àØ˜A‘ñ
ô×$Ñ$ [´+×2LÑ2LÓMð
ðØŸ™ØŸ
™
ò

ˆ ð ×ј{¨K¯O©O¸GÀWÓ,MÔNØ!�r—z‘z 4 &¬3¨r«7Ñ"2°BÑF¸+ÑFˆŒ ð
×ј'Ô"à ×ÑÐ/°·±Ô?Ø �=Š=Ø × Ñ ˜|¨T¯[©[Ô 9ä×0Ñ0¸)¸ÔEˆ�ùôIAùò
Ks Ã.K7Ä1K>có—|j|«s|jj«ry|jj|jj
«|_|jj|j«y©z,Internal event handler to clear the buttons.N) rBrOÚ is_savingÚcopy_from_bboxrIr“rƒr‘rŽr@s rr‘zCheckButtons._clearAsU€à �;‰;�uÔ  §¡×!6Ñ!6Ô!8Ø ØŸ;™;×5Ñ5°d·g±g·l±lÓCˆÔØ �‰×јDŸL™LÕ)r!cóv—|j|«s-|jdk7s|jj|«dsyg|jj|«dd¢t |j «D��cgc]\}}|j|«dsŒ|‘Œc}}¢}|r’|jj«j|jj««}|j||j|jf||z
dzjd«j««yycc}}w©NrrÚindr)rw)rBrrIrˆr�Ú enumerater†Úget_offset_transformraÚ get_offsetsr;rbrcÚsumrÉ©rrAÚirÚidxsÚcoordss rr�zCheckButtons._clickedHs€Ø �;‰;�uÔ  §¡°Ò!2¸$¿'¹'×:JÑ:JÈ5Ó:QÐRSÒ:TØ ðSØ
�\‰\×
"Ñ
" 5Ó
)¨!Ñ
,¨UÑ
3ðSä(¨¯©Ó5×
Q‘G�A�t¸¿¹ÀuÓ9MÈaÓ9PŠaÓ
QðSˆñ Ø—\‘\×6Ñ6Ó8×BÑBØ— ‘ ×(Ñ(Ó*ó,ˆFà �O‰OؘŸ™ §¡Ð)¨F°4©LÑ8¸QÑ>×CÑCÀBÓG×NÑNÓPÑQõ
Sð ùóRó Á:D5ÂD5có®—tjt|¬«t|«}t |j
|«D]\}}|j
|«Œy)a$
Set properties of the `.Text` labels.
.. versionadded:: 3.7
Parameters
----------
props : dict
Dictionary of `.Text` properties to be used for the labels. Same
format as label_props argument of :class:`CheckButtons`.
rnN©rr€r�rpr…r†Úupdate©rrorÚprops rÚset_label_propszCheckButtons.set_label_propsTóH€ô
×Ñœd¨%Õ0Ü" 5Ó)ˆÜ˜dŸk™k¨5Ó1ò ‰JˆD�$Ø �K‰K˜Õ ñ r!cóî—tjt|¬«d|vr;tj|j d«t
|j««|d<|jj|«y)zþ
Set properties of the check button frames.
.. versionadded:: 3.7
Parameters
----------
props : dict
Dictionary of `.Collection` properties to be used for the check
button frames.
rnrÚsizesN)
rr€r�rÆÚ broadcast_tor‹r‚r†r�r§©rros rÚset_frame_propszCheckButtons.set_frame_propsesR€ô
×Ñœd¨%Õ0Ø �%‰<ÜŸ_™_¨U¯Y©Y°s«^¼SÀÇÁÓ=MÓNˆE�'‰NØ � ‰ ×јEÕ"r!có0—tjt|¬«d|vr;tj|j d«t
|j««|d<|j«}|jj|«|j|«y)zý
Set properties of the check button checks.
.. versionadded:: 3.7
Parameters
----------
props : dict
Dictionary of `.Collection` properties to be used for the check
button check.
rnrr­N) rr€r�rÆr®r‹r‚r†Ú
get_statusrŽr§r�)rror’s rÚset_check_propszCheckButtons.set_check_propsvsl€ô
×Ñœd¨%Õ0Ø �%‰<ÜŸ_™_¨U¯Y©Y°s«^¼SÀÇÁÓ=MÓNˆE�'‰NØ—/‘/Ó#ˆØ � ‰ ×јEÔ"à ×ј'Õ"r!cóˆ—|tt|j««vrtd|›�«‚t j
t df|¬«tjd«}|jj«}|€tj|||«}|r|j|n|||<|jj|«|jr¬|jr†|j �%|j"j%|j «|j&j)|j«|j"j+|j&j,«n|j"j/«|j0r8|j2j5d|j|j7««yy)a
Modify the state of a check button by index.
Callbacks will be triggered if :attr:`eventson` is True.
Parameters
----------
index : int
Index of the check button to toggle.
state : bool, optional
If a boolean value, set the state explicitly. If no value is
provided, the state is toggled.
Raises
------
ValueError
If *index* is invalid.
TypeError
If *state* is not boolean.
zInvalid CheckButton index: N©Ústaterzrm)Úranger‚r†r%rr€Úboolr
Úto_rgbarŽr�r�Ú_active_check_colorsrrCrxrƒrOÚrestore_regionrIr‘r’r“r”rDrzr�Úget_text)rÚindexr¶Ú invisibleÚ
facecolorss rr;zCheckButtons.set_activeŠsL€ð, œœc $§+¡+Ó.Ó/Ñ /ÜÐ:¸5¸'ÐBÓCÐ CÜ ×Ñœt T˜l°%Õ8ä—N‘N 6Ó*ˆ à—\‘\×/Ñ/Ó1ˆ
Ø ˆ=Ü×%Ñ% j°Ñ&7¸ÓCˆEÙ@E˜D×5Ñ5°eÒ<È9ˆ
�5ÑØ � ‰ ×"Ñ" :Ô.à �;Š;Ø�}Š}Ø×#Ñ#Ð/Ø—K‘K×.Ñ.¨t×/?Ñ/?Ô@Ø—‘×#Ñ# D§L¡LÔ1Ø— ‘ × Ñ  §¡§¡Õ.à— ‘ × Ñ Ô"à �=Š=Ø �O‰O× #Ñ # I¨t¯{©{¸5Ñ/A×/JÑ/JÓ/LÕ Mð r!cój—|jj«|_t|j«dk(r0t j
|jt|«d¬«|_|jj
t|j|«D��cgc] \}}|r|nd‘Œ
c}}«ycc}}w)a
Initialize properties to match active status.
The user may have passed custom colours in *check_props* to the
constructor, or to `.set_check_props`, so we need to modify the
visibility after getting whatever the user set.
rr©rÃrzN)rŽr�rºr‚rÆrmrr…)rr’Úecr:s rr�zCheckButtons._init_status¸s˜€ð%)§L¡L×$>Ñ$>Ó$@ˆÔ!Ü ˆt×(Ñ(Ó )¨QÒ .Ü(*¯ © °$×2KÑ2KÜ25°g³,ÀQô)HˆDÔ %à � ‰ ×"Ñ"ä" 4×#<Ñ#<¸gÓF÷
HÙ��Vñ‰R˜vÑ
%ó
Hõ Iùó
HsÂB/
cóŠ—|jjdgt|j«z«t |d«r6|j
D]'\}}|j
d«|j
d«Œ)|jr|jj«|jr|jjdd«yy)zUncheck all checkboxes.rzÚ_linesFrmN)
rŽrr‚rºrôrÄÚ set_visiblerCrOr”rDrzr�)rÚl1Úl2s rÚclearzCheckButtons.clearÈsš€ð
� ‰ ×"Ñ" F 8¬c°$×2KÑ2KÓ.LÑ#LÔMä �4˜Ô "ØŸ+™+ò
&‘��BØ—‘˜uÔ%Ø—‘˜uÕ%ð
&ð �;Š;Ø �K‰K× Ñ Ô à �=Š=à �O‰O× #Ñ # I¨tÕ 4ð r!c ó¬—|jj«D�cgc],}tj|tjd«« ‘Œ.c}Scc}w)zW
Return a list of the status (True/False) of all of the check buttons.
rz)rŽÚget_facecolorsr
r�r¹)rr‚s rr²zCheckButtons.get_statusÙsJ€ð
"Ÿ\™\×8Ñ8Ó:ö<Øô×%Ñ% e¬V¯^©^¸FÓ-CÓDÒDò<ð <ùò<s�1Acóœ—t|j|j««D��cgc]\}}|r|j«‘Œc}}Scc}}w)z2Return a list of labels currently checked by user.)r…r†r²r¼)rÚlÚ box_checkeds rÚget_checked_labelszCheckButtons.get_checked_labelsàsB€ô�D—K‘K §¡Ó!2Ó3÷ ¡  Káð—
‘
• ó ð ùó s¨AcóB‡—|jjdˆfd„«S)á 
Connect the callback function *func* to button click events.
Parameters
----------
func : callable
When the button is clicked, call *func* with button label.
When all buttons are cleared, call *func* with None.
The callback func must have the signature::
def func(label: str | None) -> Any
Return values may exist, but are ignored.
Returns
-------
A connection id, which can be used to disconnect the callback.
rmcó•—‰|«Srr4©rr˜s €rrPz)CheckButtons.on_clicked.<locals>.<lambda>ús ø€¹tÀD»z€r!r™r›s `rrœzCheckButtons.on_clickedçsø€ð&�‰×&Ñ& yÓ2IÓJÐJr!có:—|jj|«y©z-Remove the observer with connection id *cid*.Nržr s rrŸzCheckButtons.disconnectür¡r!r)r0r1r2r3r r‘r�rªr°r³r;r�rÈr²rÎrœrŸr¢r£s@rrrrrÐsaø„ñð ^F¸DØ!¨tÀö^Fò@*ò
Sòò"#ò"#ó(,Nò\Iò 5ò"<ò òKö*(r!rrc󈇗eZdZdZddddddœˆfd„ Zed„«Zd „Zd
„Zd „Z d „Z
d
„Z d„Z d„Z
d„Zd„Zd„Zd„Zd„ZˆxZS)ÚTextBoxaP
A GUI neutral text input box.
For the text box to remain responsive you must keep a reference to it.
Call `.on_text_change` to be updated whenever the text changes.
Call `.on_submit` to be updated whenever the user hits enter or
leaves the text entry field.
Attributes
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
label : `~matplotlib.text.Text`
color : :mpltype:`color`
The color of the text box when not hovering.
hovercolor : :mpltype:`color`
The color of the text box when hovering.
z.95Ú1g{®Gáz„?ró)r‚rƒÚ label_padÚ
textalignmentc
óf•—t‰|�|«tjddddœ|¬«|_|j | d||j dd¬«|_|jj |jd||jj d|d ¬
«|_ tjd d g¬
«|_ |jddd |gg¬«d|_|jdddd ddt j"j%«¬«|_|j)d|j*«|j)d|j,«|j)d|j.«|j)d|j0«|j)d|j2«||_||_d |_y)a‡
Parameters
----------
ax : `~matplotlib.axes.Axes`
The `~.axes.Axes` instance the button will be placed into.
label : str
Label for this text box.
initial : str
Initial value in the text box.
color : :mpltype:`color`
The color of the box.
hovercolor : :mpltype:`color`
The color of the box when the mouse is over it.
label_pad : float
The distance between the label and the right side of the textbox.
textalignment : {'left', 'center', 'right'}
The horizontal location of the text.
çš™™™™™©?rigffffffî?)rórjrò)rÙrjròrïF)rarkrlÚ
parse_mathÚchangeÚsubmitrn©rr)ÚxlimÚylimÚnavigateráÚxticksÚyticksrrr)Úvisibler‚rérarprqrrÚkey_press_eventÚ resize_eventN)rsr rÚ
check_getitemÚ_text_positionrrurvrIÚ text_dispr ryrzÚsetÚ cursor_indexÚvlinesÚmplrÚIdentityTransformÚcursorrVr{r|r}Ú _keypressÚ_resizer‚rƒÚcapturekeystrokes) rrIrvÚinitialr‚rƒrØrÙr…s €rr zTextBox.__init__s�ø€ô* ‰Ñ˜Ôä"×0Ñ0Ø S°4Ñ 8Ø'ô)ˆÔð—W‘WØ
ˆJ˜˜U¨b¯l©lØ&¸GðóEˆŒ
ð
Ÿ™Ÿ™Ø × Ñ   g¸¿¹×9JÑ9JØ&¸MØð&óˆŒô
 ×0Ñ0¸(ÀHÐ9MÔNˆŒà
�‰Ø˜fØ eؘbð ô "ð
ˆÔà—i‘i  1 a°¸cÀaÜ*-¯.©.×*JÑ*JÓ*Lð óNˆŒ ð
×ÑÐ/°·±Ô=Ø ×ÑÐ1°4·=±=ÔAØ ×ÑÐ0°$·,±,Ô?Ø ×ÑÐ,¨d¯n©nÔ=Ø ×ј>¨4¯<©<Ô8àˆŒ
Ø$ˆŒà!&ˆÕr!có6—|jj«Sr)rêr¼rs rrz TextBox.textTs€à�~‰~×&Ñ&Ó(Ð(r!cóª—|jjd¬«}|j«€|jj «|j
j
«}|d|j}|j
j«}|j
j|xsd«|j
j«}|j|jk(rE|xj|jdz zc_
|xj|jdz z
c_ n2|s|j|_n|j|jz|_|j j#|j|jf|j|jfggd¬«|j
j|«|jj «y)NTrLú,r))Úsegmentsrå)rIrNÚ
_get_rendererrOr”rêr¼rìÚget_window_extentrÚy0Úy1ÚheightÚx0Úx1Úwidthrðrë)rÚfigrÚ widthtextÚbb_textÚ bb_widthtexts rÚ
_rendercursorzTextBox._rendercursorXs]€ð�g‰g× Ñ  dÐ Ó+ˆØ × Ñ Ó Ð &Ø �J‰J�O‰OÔ à�~‰~×&Ñ&Ó(ˆØÐ+˜$×+Ñ+Ð,ˆ à—.‘.×2Ñ2Ó4ˆØ �‰×Ñ  Ò 0¨SÔ1Ø—~‘~×7Ñ7Ó9ˆ à �:‰:˜Ÿ™Ò #Ø �JŠJ˜,×-Ñ-°Ñ1Ñ 1�JØ �JŠJ˜,×-Ñ-°Ñ1Ñ 1ŽJÙØ Ÿ™ˆG�Jà Ÿ™ l×&8Ñ&8Ñ8ˆGŒJà � ‰ �‰ØŸ
™
 G§J¡JÐ/°'·*±*¸g¿j¹jÐ1IÐJÐKØð ô ð
�‰×Ñ Ô%à �
‰
�‰Õr!cóº—|j|«ry|jj|jk7ry|jj |j«yr)rBrOr‰rIrŒr@s rr|zTextBox._release{s@€Ø �;‰;�uÔ Ø Ø �<‰<× %Ñ %¨¯©Ò 0Ø Ø
� ‰ ×"Ñ" 4§7¡7Õ+r!có>—|j|«ry|j�rþ|j}|j}t |«dk(r9|d|j
|z||j
dz}|xj
dz
c_�n|dk(r.|j
t |«k7rø|xj
dz
c_nâ|dk(r%|j
dk7rÎ|xj
dzc_n¸|dk(rd|_n«|dk(rt |«|_n•|dk(rG|j
dk7r�|d|j
dz
||j
dz}|xj
dzc_nI|dk(rD|j
t |j«k7r"|d|j
||j
dzdz}|j j|«|j«|jrR|jjd |j«|d
vr'|jjd |j«yyyy) NrròrórÚhomeÚendÚ backspaceÚdeleterÝ)ÚenterÚreturnrÞ) rBróÚkeyrr‚rìrêrrrDrzr�)rrArrs rrñzTextBox._keypress‚sõ€Ø �;‰;�uÔ Ø Ø × !Ó !Ø—)‘)ˆCØ—9‘9ˆDÜ�3‹x˜1Š}ØÐ/˜d×/Ñ/Ð0°3Ñ6ؘT×.Ñ.Ð/Ð0ñ1�à×!Ò! QÑ&×!ؘ’Ø×$Ñ$¬¨D« Ò1Ø×%Ò%¨Ñ*Ö%ؘ’Ø×$Ñ$¨Ò)Ø×%Ò%¨Ñ*Ö%ؘ’Ø$%�Õ!ؘ’Ü$'¨£I�Õ!ؘ Ò#Ø×$Ñ$¨Ò)Ø Ð!7 $×"3Ñ"3°aÑ"7Ð8Ø  ×!2Ñ!2Ð!3Ð4ñ5�Dà×%Ò%¨Ñ*Ö%ؘ’Ø×$Ñ$¬¨D¯I©I«Ò6Ø Ð!3 $×"3Ñ"3Ð4Ø  ×!2Ñ!2°QÑ!6Ð!7Ð8ñ9�Dà �N‰N× #Ñ # DÔ )Ø × Ñ Ô Ø�}Š}Ø—‘×'Ñ'¨°$·)±)Ô<ØÐ-Ñ-Ø—O‘O×+Ñ+¨H°d·i±iÕ@ð.ðð9 "r!cóB—t|«}|j|k(ry|jj|«|j «|j
rM|j jd|j«|j jd|j«yy)NrÝrÞ)ÚstrrrêrrrDrzr�)rrËÚnewvals rrÑzTextBox.set_val¦st€Ü�S“ˆØ �9‰9˜Ò Ø Ø �‰×Ñ Ô'Ø ×ÑÔØ �=Š=Ø �O‰O× #Ñ # H¨d¯i©iÔ 8Ø �O‰O× #Ñ # H¨d¯i©iÕ 8ð r!c ó4—d|_t«}|j|_t |j
j
d¬«jjdd«}|�8|j|«|j|jj|«ytj«5|jtj tj"D�cic]}|j%d«sŒ|g“Œc}««ddd«ycc}w#1swYyxYw)NTrLÚ toolmanagerzkeymap.)rórÚcloseÚ_on_stop_typingÚgetattrrIrNrOÚmanagerÚ keypresslockrTr*rÚ'suppress_matplotlib_deprecation_warningÚ
enter_contextrîÚ
rc_contextÚrcParamsÚ
startswith)rÚstackrrs rÚ begin_typingzTextBox.begin_typing°së€Ø!%ˆÔô“ ˆØ$Ÿ{™{ˆÔÜØ �G‰G× Ñ  DÐ Ó )× 0Ñ 0× 8Ñ 8¸-ÈóOˆ à Ð "ð
× $Ñ $ TÔ *Ø �N‰N˜;×3Ñ3×;Ñ;¸TÕ Bô×=Ñ=Ó?ñ
OØ×#Ñ#¤C§N¡NÜ$'§L¡LÖL˜q°A·L±LÀÕ4K�Q˜‘UÒLó%NôO÷
Oð
OùâL÷
Oð
Oús$Â,-DÃD Ã0D Ã5 DÄ DÄDcól—|jr|j«d|_d}nd}d|_|jjd«|jj d¬«j j«|r4|jr'|jjd|j«yyy)NTFrLrÞ) rórrðrÅrIrNrOr”rDrzr�r)rÚ notifysubmits rÚ stop_typingzTextBox.stop_typingÅs‘€Ø × !Ò !Ø × Ñ Ô "Ø#'ˆDÔ Ø‰Là ˆLØ!&ˆÔØ � ‰ ×Ñ Ô&Ø �‰×Ñ ÐÓ%×,Ñ,×1Ñ1Ô3Ù ˜DŸMšMð
�O‰O× #Ñ # H¨d¯i©iÕ 8ð*ˆ<r!cóÜ—|j|«ry|jj|«ds|j«y|jsy|j
j |jk7r%|j
j|j«|js|j«|jj|j«|_
|j«yr‡)rBrIrˆr"rDrOr‰rŠrórrêÚ_char_index_atrbrìrr@s rr{zTextBox._clickÔs©€Ø �;‰;�uÔ Ø Ø�w‰w×Ñ Ó& qÒ)Ø × Ñ Ô Ø Ø�}Š}Ø Ø �<‰<× %Ñ %¨¯©Ò 0Ø �L‰L× #Ñ # D§G¡GÔ ,Ø×%Ò%Ø × Ñ Ô Ø ŸN™N×9Ñ9¸%¿'¹'ÓBˆÔØ ×ÑÕr!có$—|j«yr)r"r@s rròzTextBox._resizeãs€Ø ×ÑÕr!cóª—|j|«ry|jj|«dr |jn |j}t j ||jj««s]|jj|«|jr5|jjd¬«jj«yyy)NrTrL)
rBrIrˆrƒr‚r
r�r�rrCrNrOr”r•s rr}zTextBox._motionæsš€Ø �;‰;�uÔ Ø Ø#Ÿw™w×/Ñ/°Ó6°qÒ9ˆD�OŠO¸t¿z¹zˆÜ× Ñ   D§G¡G×$9Ñ$9Ó$;Ô<Ø �G‰G× !Ñ ! !Ô $Ø�{Š{Ø—‘×"Ñ"¨Ð"Ó-×4Ñ4×9Ñ9Õ;ðð=r!cóB‡—|jjdˆfd„«S)z‹
When the text changes, call this *func* with event.
A connection id is returned which can be used to disconnect.
rÝcó•—‰|«Srr4rÒs €rrPz(TextBox.on_text_change.<locals>.<lambda>õó ø€¹dÀ4»j€r!r™r›s `rÚon_text_changezTextBox.on_text_changeïsø€ð �‰×&Ñ& xÓ1HÓIÐIr!cóB‡—|jjdˆfd„«S)z³
When the user hits enter or leaves the submission box, call this
*func* with event.
A connection id is returned which can be used to disconnect.
rÞcó•—‰|«Srr4rÒs €rrPz#TextBox.on_submit.<locals>.<lambda>þr)r!r™r›s `rÚ on_submitzTextBox.on_submit÷sø€ð�‰×&Ñ& xÓ1HÓIÐIr!có:—|jj|«yrÔržr s rrŸzTextBox.disconnectr¡r!)Ú)r0r1r2r3r rErrr|rñrÑrr"r{ròr}r*r-rŸr¢r£s@rrÖrÖssø„ñð,:'ب¸Ø%ö:'ðxñ)óð)ò!òF,ò"AòH9òOò*
9ò
òò<òJòJö(r!rÖcó’‡—eZdZdZdddddœˆfd„ Zd„Zd„Zd„Zd „Ze d
„«Z
e
jd „«Z
d „Z d
„Z
d„Zd„ZˆxZS)Ú RadioButtonsaI
A GUI neutral radio button.
For the buttons to remain responsive you must keep a reference to this
object.
Connect to the RadioButtons with the `~._Buttons.on_clicked` method.
Attributes
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
activecolor : :mpltype:`color`
The color of the selected button.
labels : list of `.Text`
The button labels.
value_selected : str
The label text of the currently selected button.
index_selected : int
The index of the selected button.
NT)rgrsÚ radio_propsc ó •—t‰|�|«tjtdf||¬«t j |tj«}|�d|vrtjd«nd}||_
||_ |||_ ||_
|jg«|jg«|j!d«t#j$ddt'|«d z«dd
}|xr|j(j*|_d|_t1|«}t3|||«D� �
� cgc])\} }
} |j4d | |
f|j6d d
dœ| ¤Ž‘Œ+c} }
} |_t#j:|j8D� cgc]} | j=«‘Œc} «d z }
d|
d zi|¥d|j6|j,dœ¥}|j?d|jAdd««|j?d|jCd|««|jDdgt'|«z|fi|¤Ž|_#|jFjI«|_%t'|jJ«dk(r0t#jL|jJt'|«d¬«|_%|jFjOtQ|jJ«D��cgc]\}}||k(r|nd‘Œc}}«|jSd|jT«|j,r|jSd|jV«t jXdg¬«|_-ycc} }
} wcc} wcc}}w)a
Add radio buttons to an `~.axes.Axes`.
Parameters
----------
ax : `~matplotlib.axes.Axes`
The Axes to add the buttons to.
labels : list of str
The button labels.
active : int
The index of the initially selected button.
activecolor : :mpltype:`color`
The color of the selected button. The default is ``'blue'`` if not
specified here or in *radio_props*.
useblit : bool, default: True
Use blitting for faster drawing if supported by the backend.
See the tutorial :ref:`blitting` for details.
.. versionadded:: 3.7
label_props : dict of lists, optional
Dictionary of `.Text` properties to be used for the labels. Each
dictionary value should be a list of at least a single element. If
the list is of length M, its values are cycled such that the Nth
label gets the (N mod M) property.
.. versionadded:: 3.7
radio_props : dict, optional
Dictionary of scatter `.Collection` properties to be used for the
radio buttons. Defaults to (label font size / 2)**2 size, black
edgecolor, and *activecolor* facecolor (when active).
.. note::
If a facecolor is supplied in *radio_props*, it will override
*activecolor*. This may be used to provide an active color per
button.
.. versionadded:: 3.7
N)rsr2rázŠBoth the *activecolor* parameter and the *facecolor* key in the *radio_props* parameter has been specified. *activecolor* will be ignored.ÚblueFrrr)rwrærórjrxrr'r}râr‚r{r|rÁrzrprrmrn).rsr rr€r�r rir rˆÚ
warn_externalÚ _activecolorÚ_initial_activeÚvalue_selectedÚindex_selectedr€r�r~rÆr„r‚rOrwrxrƒrpr…rrur†r.r‡r‰rŠr‹rŒÚ_buttonsr�Ú_active_colorsrmrrœrVr�r‘ryrz)rrIr†r:Ú activecolorrgrsr2r“rcrvrorr”r¡r…s €rr zRadioButtons.__init__s ø€ôR ‰Ñ˜Ôä ×Ñœt T˜l¸ Ø*5õ 7ô×,Ñ,¨[Ü-8×-GÑ-GóIˆ à Ð "ؘkÑ)Ü×"Ñ"ð5õ6ð
!ˆKà'ˆÔØ%ˆÔØ$ V™nˆÔØ$ˆÔà
�
‰
�bÔØ
�
‰
�bÔØ
�‰˜Ôä
�[‰[˜˜Aœs 6›{¨Q™Ó
/°°"Ð
5ˆàÒ= D§K¡K×$=Ñ$=ˆŒ
؈Ôä(¨Ó5ˆ ô
$' r¨6°;Ó#?÷ AðAñ ��5˜%ð
ˆB�G‰G�D˜!˜Uð
¨b¯l©lØ(.À(ñ
àó
ôAˆŒ ô
—H‘H¸d¿k¹kÖJ°d˜d×/Ñ/Õ1ÒJÓKÈaÑOˆ ð
�˜A‘ð
àð
ðØŸ™ØŸ
™
ò 
ˆ ð ×ј{¨K¯O©O¸GÀWÓ,MÔNØ×ј{Ø*Ÿ™¨w¸ ÓDô Fà"˜Ÿ
™
 C 5¬3¨r«7¡?°BÑF¸+ÑFˆŒ
ð#Ÿm™m×9Ñ9Ó;ˆÔÜ ˆt×"Ñ"Ó # qÒ (Ü"$§)¡)¨D×,?Ñ,?ÄÀVÃØ12ô#4ˆDÔ à �
‰
×#Ñ#ä#,¨T×-@Ñ-@Ó#A÷
CÙ��Kð šK‰[¨VÑ
3ó
Cô Dð
×ÑÐ/°·±Ô?Ø �=Š=Ø × Ñ ˜|¨T¯[©[Ô 9ä×0Ñ0¸)¸ÔEˆ�ùôCAùò
Kùó*
CsÄ+.L>ÆMËM
có—|j|«s|jj«ry|jj|jj
«|_|jj|j«yr–) rBrOr—r˜rIr“rƒr‘r:r@s rr‘zRadioButtons._clear‡sU€à �;‰;�uÔ  §¡×!6Ñ!6Ô!8Ø ØŸ;™;×5Ñ5°d·g±g·l±lÓCˆÔØ �‰×јDŸM™MÕ*r!cóv—|j|«s-|jdk7s|jj|«dsyg|jj|«dd¢t |j «D��cgc]\}}|j|«dsŒ|‘Œc}}¢}|r’|jj«j|jj««}|j||j|jf||z
dzjd«j««yycc}}wrš)rBrrIrˆr:rœr†r�raržr;rbrcrŸrÉr s rr�zRadioButtons._clickedŽs€Ø �;‰;�uÔ  §¡°Ò!2¸$¿'¹'×:JÑ:JÈ5Ó:QÐRSÒ:TØ ðSØ
�]‰]×
#Ñ
# EÓ
*¨1Ñ
-¨eÑ
4ðSä(¨¯©Ó5×
Q‘G�A�t¸¿¹ÀuÓ9MÈaÓ9PŠaÓ
QðSˆñ Ø—]‘]×7Ñ7Ó9×CÑCØ—
‘
×)Ñ)Ó+ó-ˆFà �O‰OؘŸ™ §¡Ð)¨F°4©LÑ8¸QÑ>×CÑCÀBÓG×NÑNÓPÑQõ
Sð ùóRr¤có®—tjt|¬«t|«}t |j
|«D]\}}|j
|«Œy)a$
Set properties of the `.Text` labels.
.. versionadded:: 3.7
Parameters
----------
props : dict
Dictionary of `.Text` properties to be used for the labels. Same
format as label_props argument of :class:`RadioButtons`.
rnNr¦r¨s rrªzRadioButtons.set_label_propsšr«r!có²—tjt|¬«d|vr;tj|j d«t
|j««|d<|jj|«|jj«|_ t
|j«dk(r:tj|jt
|j«d¬«|_ |jjt|j|j«D��cgc]&\}}|j«|j k(r|nd‘Œ(c}}«ycc}}w) zó
Set properties of the `.Text` labels.
.. versionadded:: 3.7
Parameters
----------
props : dict
Dictionary of `.Collection` properties to be used for the radio
buttons.
rnrr­rrrÁrzN)rr€r�rÆr®r‹r‚r†r:r§r�r;rmrr…r¼r8)rrorr<s rÚset_radio_propszRadioButtons.set_radio_props«s€ô
×Ñœd¨%Õ0Ø �%‰<ÜŸ_™_¨U¯Y©Y°s«^¼SÀÇÁÓ=MÓNˆE�'‰NØ �
‰
×јUÔ#Ø"Ÿm™m×9Ñ9Ó;ˆÔÜ ˆt×"Ñ"Ó # qÒ (Ü"$§)¡)¨D×,?Ñ,?Ü,/°· ± Ó,<À1ô#FˆDÔ à �
‰
×#Ñ#ä&)¨$¯+©+°t×7JÑ7JÓ&K÷
MÙ"��{ð!ŸM™M›O¨t×/BÑ/BÒB‰[ÈÑ
Nó
Mõ Nùó
MsÄ+E
có—|jSr)r6rs rr<zRadioButtons.activecolorÃs€à× Ñ Ð r!cód—tj|¬«||_|jd|i«y)N)r<rá)r
Ú_check_color_liker6rA)rr<s rr<zRadioButtons.activecolorÇs+€ä× Ñ ¨[Õ9Ø'ˆÔØ ×јk¨;Ð7Õ8r!cóŽ—|tt|j««vrtd|›�«‚|j|j «|_||_|jj«}tjd«|ddtj|j|«||<|jj|«|jr¬|jr†|j�%|j j#|j«|j$j'|j«|j j)|j$j*«n|j j-«|j.r8|j0j3d|j|j ««yy)a9
Select button with number *index*.
Callbacks will be triggered if :attr:`eventson` is True.
Parameters
----------
index : int
The index of the button to activate.
Raises
------
ValueError
If the index is invalid.
zInvalid RadioButton index: rzNrm)r·r‚r†r%r¼r8r9r:r�r
r¹r;rrCrxrƒrOr»rIr‘r’r“r”rDrzr�)rr½Úbutton_facecolorss rr;zRadioButtons.set_activeÍsL€ð œœc $§+¡+Ó.Ó/Ñ /ÜÐ:¸5¸'ÐBÓCÐ CØ"Ÿk™k¨%Ñ0×9Ñ9Ó;ˆÔØ#ˆÔØ ŸM™M×7Ñ7Ó9ÐÜ%Ÿ~™~¨fÓ5Й!ÐÜ#)§>¡>°$×2EÑ2EÀeÑ2LÓ#MИ%Ñ Ø �
‰
×#Ñ#Ð$5Ô6à �;Š;Ø�}Š}Ø×#Ñ#Ð/Ø—K‘K×.Ñ.¨t×/?Ñ/?Ô@Ø—‘×#Ñ# D§M¡MÔ2Ø— ‘ × Ñ  §¡§¡Õ.à— ‘ × Ñ Ô"à �=Š=Ø �O‰O× #Ñ # I¨t¯{©{¸5Ñ/A×/JÑ/JÓ/LÕ Mð r!có:—|j|j«y)z4Reset the active button to the initially active one.N)r;r7rs rrÈzRadioButtons.clearòs€à �‰˜×,Ñ,Õ-r!có:—|jjd|«S)rÐrmr™r›s rrœzRadioButtons.on_clickedös€ð&�‰×&Ñ& y°$Ó7Ð7r!có:—|jj|«yrÔržr s rrŸzRadioButtons.disconnect r¡r!)rN)r0r1r2r3r r‘r�rªrArEr<Úsetterr;rÈrœrŸr¢r£s@rr1r1sxø„ñð,iFب4¸TöiFòV+ò
Sòò"Nð0ñ!óð!ð×Ññ9óð9ò
#NòJ.ò8ö*(r!r1có"—eZdZdZd„Zd„Zd„Zy)Ú SubplotToolz=
A tool to adjust the subplot params of a `.Figure`.
c ót—||_||_|jdd¬«|jd«g|_gd¢}t ||j
t|«dz««D]p\}}|jd«t||ddt|j|«¬ «}|j|j«|jj|«Œr|jd
j!«|j\|_|_|_|_|_|_|j"|j$|j*|j,fD] }d|_Œ |j&|j(fD] }d|_Œ |j&|j"_|j"|j&_|j(|j$_|j$|j(_|j7gd ¢«}t9|d «|_|j:j=|j>«y
)zø
Parameters
----------
targetfig : `~matplotlib.figure.Figure`
The figure instance to adjust.
toolfig : `~matplotlib.figure.Figure`
The figure instance to embed the subplot tool into.
çš™™™™™É?gÍÌÌÌÌÌì?)róròz'Click on slider to adjust subplot param)rórîròrñÚwspaceÚhspacerFr)rÐrw)gš™™™™™é?rÛr|g333333³?ÚResetN) ÚfigureÚ targetfigÚsubplots_adjustÚsuptitleÚ_slidersr…Úsubplotsr‚r~rÔrÚ subplotparsr$Ú_on_slider_changedrSÚaxesÚremoveÚ
sliderleftÚ sliderbottomÚ sliderrightÚ slidertopÚ sliderwspaceÚ sliderhspacer¯r®rØr×Úadd_axesrfÚ buttonresetrœÚ _on_reset)rrSÚtoolfigÚnamesr¬rIÚsliderÚbaxs rr zSubplotTool.__init__så€ðˆŒ Ø"ˆŒØ×Ñ S°ÐÔ4Ø×ÑÐBÔCàˆŒ
ÚFˆä˜E 7×#3Ñ#3´C¸³JÀ±NÓ#CÓDò )‰HˆD�"Ø �O‰O˜EÔ "ܘB  a¨Ü$+¨I×,AÑ,AÀ4Ó$HôJˆFà × Ñ ˜d×5Ñ5Ô 6Ø �M‰M× Ñ  Õ (ð  )ð � ‰ �RÑ×ÑÔ!à15·±ñ /ˆŒ˜$Ô+¨TÔ-=¸t¼~Ø
Ô ˜DÔ-Ø—‘¨×(9Ñ(9Ø×(Ñ(¨$×*;Ñ*;ð=ò %ˆFà$ˆFÕ ð %ð×'Ñ'¨¯©Ð8ò %ˆFØ$ˆFÕ ð %ð%)×$4Ñ$4ˆ�‰Ô!Ø%)§_¡_ˆ×ÑÔ"Ø&*§n¡nˆ×ÑÔ#Ø#'×#4Ñ#4ˆ�‰Ô à×ÑÒ7Ó8ˆÜ! # wÓ/ˆÔØ ×Ñ×#Ñ# D§N¡NÕ3r!c ó—|jjdi|jD�cic]'}|jj «|j
“Œ)c}¤Ž|j r%|jjj«yycc}wrh) rSrTrVrvr¼rËrCrOr”)rrrgs rrYzSubplotTool._on_slider_changed@st€Ø&ˆ�‰×&Ñ&ñ -à!Ÿ]™]ö,Øð�|‰|×$Ñ$Ó&¨¯
©
Ñ2ò,ò -ð �;Š;Ø �N‰N× !Ñ !× &Ñ &Õ (ð ùò,s§,B
c ó°—t«5}|jtj|d¬««|jD])}|jtj|dd¬««Œ+|jD]}|j «Œ ddd«|j r|jj«|jd«y#1swYŒAxYw)NF)rC)rCrD)
rrr Ú _setattr_cmrVrÒrCrOr”rY)rrArrgs rrdzSubplotTool._on_resetGs¶€Ü
‹[ð
˜Eð
× Ñ ¤× 1Ñ 1°$¸uÔ EÔ FØŸ-™-ò
M�Ø×#Ñ#Ü×%Ñ% f°UÀUÔKõMð
MðŸ-™-ò
�Ø— ‘ •ñ
÷
ð �;Š;Ø �L‰L× Ñ Ô Ø ×Ñ Õ%÷
ð
ús ‹BC à CN)r0r1r2r3r rYrdr4r!rrLrLs„ñò)4òV)ó&r!rLcó8‡—eZdZdZddddœˆfd„
Zd„Zd„ZˆxZS)ÚCursora+
A crosshair cursor that spans the Axes and moves with mouse cursor.
For the cursor to remain responsive you must keep a reference to it.
Parameters
----------
ax : `~matplotlib.axes.Axes`
The `~.axes.Axes` to attach the cursor to.
horizOn : bool, default: True
Whether to draw the horizontal line.
vertOn : bool, default: True
Whether to draw the vertical line.
useblit : bool, default: False
Use blitting for faster drawing if supported by the backend.
See the tutorial :ref:`blitting` for details.
Other Parameters
----------------
**lineprops
`.Line2D` properties that control the appearance of the lines.
See also `~.Axes.axhline`.
Examples
--------
See :doc:`/gallery/widgets/cursor`.
TF)ÚhorizOnÚvertOnrgc óæ•—t‰|�|«|jd|j«|jd|j«d|_||_||_|xr|jj|_
|jrd|d<|j|j«dfddi|¤Ž|_
|j|j«dfddi|¤Ž|_d|_d|_y)NrrrTr~rråF)rsr rVÚonmoverÈrårnrorOrwrgrüÚ
get_yboundÚlinehrÿÚ
get_xboundÚlinevÚ
backgroundÚ needclear)rrIrnrorgÚ linepropsr…s €rr zCursor.__init__tsÑø€ä
‰Ñ˜Ôà ×ÑÐ0°$·+±+Ô>Ø ×ј<¨¯©Ô4àˆŒ ؈Œ ؈Œ ØÒ< 4§;¡;×#<Ñ#<ˆŒ à �<Š<Ø$(ˆI�jÑ !Ø�R—Z‘Z §
¡
£°Ñ 2ÑO¸EÐOÀYÑOˆŒ
Ø�R—Z‘Z §
¡
£°Ñ 2ÑO¸EÐOÀYÑOˆŒ
àˆŒØˆ�r!cóÞ—|j|«s|jj«ry|jr5|jj |j
j «|_yy)z+Internal event handler to clear the cursor.N)rBrOr—rgr˜rIr“rvr@s rrÈz Cursor.clearˆsJ€à �;‰;�uÔ  §¡×!6Ñ!6Ô!8Ø Ø �<Š<Ø"Ÿk™k×8Ñ8¸¿¹¿¹ÓFˆD�Oð r!cóÚ—|j|«ry|jjj|«sy|jj |«dsd|j jd«|jjd«|jr!|jj«d|_ yd|_ |j|«\}}|j j||f«|j j|jxr |j«|jj||f«|jj|jxr |j «|jr|js
|j sy|j"r«|j$�%|jj'|j$«|jj)|j «|jj)|j«|jj+|jj,«y|jj/«y)z?Internal event handler to draw the cursor when the mouse moves.NrFT)rBrOÚ
widgetlockr$rIrˆrurÅrsrwr”rdrrårorrnrgrvr»r‘r’r“r©rrAr]r^s rrqz
Cursor.onmove�s €à �;‰;�uÔ Ø Ø�{‰{×%Ñ%×/Ñ/°Ô5Ø Ø�w‰w×Ñ Ó& qÒ)Ø �J‰J× "Ñ " 5Ô )Ø �J‰J× "Ñ " 5Ô )Ø�~Š~Ø— ‘ × Ñ Ô"Ø!&�”Ø ØˆŒØ×,Ñ,¨UÓ3‰ ˆˆuØ �
‰
×јe U˜^Ô,Ø �
‰
×јtŸ|™|Ò;°· ± Ô<Ø �
‰
×јe U˜^Ô,Ø �
‰
×јtŸ|™|Ò<°· ± Ô=Ø— ’  $§+¢+°·²Ø à �<Š<Ø�‰Ð*Ø— ‘ ×*Ñ*¨4¯?©?Ô;Ø �G‰G× Ñ  §
¡
Ô +Ø �G‰G× Ñ  §
¡
Ô +Ø �K‰K× Ñ ˜TŸW™WŸ\™\Õ *à �K‰K× !Ñ !Õ #r!)r0r1r2r3r rÈrqr¢r£s@rrmrmXs!ø„ñð6'+°4Àöò(Gö$r!rmcó8—eZdZdZddddœd„Zd„Zd„Zd„Zd „Zy
) Ú MultiCursoraÃ
Provide a vertical (default) and/or horizontal line cursor shared between
multiple Axes.
For the cursor to remain responsive you must keep a reference to it.
Parameters
----------
canvas : object
This parameter is entirely unused and only kept for back-compatibility.
axes : list of `~matplotlib.axes.Axes`
The `~.axes.Axes` to attach the cursor to.
useblit : bool, default: True
Use blitting for faster drawing if supported by the backend.
See the tutorial :ref:`blitting`
for details.
horizOn : bool, default: False
Whether to draw the horizontal line.
vertOn : bool, default: True
Whether to draw the vertical line.
Other Parameters
----------------
**lineprops
`.Line2D` properties that control the appearance of the lines.
See also `~.Axes.axhline`.
Examples
--------
See :doc:`/gallery/widgets/multicursor`.
TF)rgrnroc ór—||_||_||_||_|D�cic]"}|j d¬«j
gddœ“Œ$c}|_|dj«\}} |dj«\}
} d|| zz} d|
| zz}
d|_ |xrtd„|j D««|_ |jrd|d<|D�cgc]}|j| fdd i|¤Ž‘Œc}|_
|D�cgc]}|j|
fdd i|¤Ž‘Œc}|_|j!«ycc}wcc}wcc}w)
NTrL)Úcidsrvrwric3ó4K—|]}|j–—Œy­wr)rw)Ú.0rOs rú <genexpr>z'MultiCursor.__init__.<locals>.<genexpr>êsèø€ÒJ¨V�F×(Õ(ÑJùs‚r~råF)Ú_canvasrZrnrorNrOÚ
_canvas_infosÚget_xlimÚget_ylimråÚallrgrÿrírüÚhlinesrš)rrOrZrgrnrorxrIÚxminÚxmaxÚyminÚymaxÚxmidÚymids rr zMultiCursor.__init__Ôsc€ðˆŒ àˆŒ ؈Œ ؈Œ ð<@öAà57ð
�M‰M˜tˆMÓ $× +Ñ +ب4Ñ0ñ
1òAˆÔð˜"‘X×&Ñ&Ó(‰
ˆˆdؘ"‘X×&Ñ&Ó(‰
ˆˆdØ�d˜T‘kÑ"ˆØ�d˜T‘kÑ"ˆàˆŒ à ò
KÜÑJ°t×7IÑ7IÔJÓJð
Œ ð �<Š<Ø$(ˆI�jÑ !ð"&ö'Øð"�r—z‘z $ÑC°ÐC¸ÓCò'ˆŒ ð"&ö'Øð"�r—z‘z $ÑC°ÐC¸ÓCò'ˆŒ ð
� ‰ �ùò-Aùò"'ùò's¡'D*Ã
D/Ã5D4có¾—|jj«D]@\}}|jd|j«|jd|j«g|d<ŒBy)zConnect events.rrrr€N)r…r÷rRrqrÈ)rrOÚinfos rršzMultiCursor.connectösX€à ×.Ñ.×4Ñ4Ó6ò ‰LˆF�Dà×"Ñ"Ð#8¸$¿+¹+ÓFØ×"Ñ" <°·±Ó<ðˆD�ŠLñ r!có¤—|jj«D]3\}}|dD]}|j|«Œ|dj«Œ5y)zDisconnect events.r€N)r…r÷rXrÈ)rrOr‘rUs rrŸzMultiCursor.disconnectþsU€à ×.Ñ.×4Ñ4Ó6ò !‰LˆF�DؘF‘|ò
+�Ø×%Ñ% cÕ*ð
+à �‰L× Ñ Õ ñ !r!có—|j|«ry|jrd|jj«D]F\}}||jj
urŒ|j
|jj«|d<ŒHyy)zClear the cursor.Nrv)rBrgr…r÷rRrOr˜r“)rrArOr‘s rrÈzMultiCursor.clearsw€à �;‰;�uÔ Ø Ø �<Š<Ø $× 2Ñ 2× 8Ñ 8Ó :ò
O‘ �˜ð
 §¡×!5Ñ!5Ñ5ØØ%+×%:Ñ%:¸6¿=¹=×;MÑ;MÓ%N��\Ò"ñ
Oð r!có~—|jD�cgc]}|j|«dsŒ|‘Œ}}|j|«s'|r%|jjj |«syt
j|«}|j|ur|j|jfn>|jj«j|j|jf«\}}|j D]>}|j#||f«|j%|j&xr |j(«Œ@|j*D]>}|j-||f«|j%|j&xr |j.«Œ@|j&r|j(s
|j.sy|j0rè|j2j5«D]\}}|dsŒ |j7|d«Œ!|j(r9t9|j|j «D]\}}|j;|«Œ|j.r9t9|j|j*«D]\}}|j;|«Œ|j2D]}|j=«Œy|j2D]}|j?«Œycc}w)Nrrv) rZrˆrBrOr{r$r Ú_topmost_artistr\r]r^r_r`rarbrcrírrÅråror‰rrnrgr…r÷r»r…r‘r’r) rrArIÚaxsr]r^ÚlinerOr‘s rrqzMultiCursor.onmoves;€Ø ŸI™IÖ?�b¨¯©°UÓ);¸AÓ)>ŠrÐ?ˆÐ?Ø �;‰;�uÔ ¡S°· ± ×0GÑ0G×0QÑ0QÐRVÔ0WØ Ü
×
"Ñ
" 3Ó
'ˆØ6;·l±lÀbÑ6H˜Ÿ™ e§k¡kÑ2ØŸ\™\×2Ñ2Ó4×>Ñ>ÀÇÁÈÏÉÐ?QÓRñ ˆˆuà—K‘Kò ;ˆDØ �N‰N˜E 5˜>Ô *Ø × Ñ ˜TŸ\™\Ò9¨d¯k©kÕ :ð ;ð—K‘Kò <ˆDØ �N‰N˜E 5˜>Ô *Ø × Ñ ˜TŸ\™\Ò:¨d¯l©lÕ ;ð <ð— ’  $§+¢+°·²Ø à �<Š<Ø $× 2Ñ 2× 8Ñ 8Ó :ò
>‘ �˜Ø˜ Ó%Ø×)Ñ)¨$¨|Ñ*<Õ=ð
>ð�{Š{Ü # D§I¡I¨t¯{©{Ó ;ò)‘H�B˜Ø—N‘N 4Õ(ð)à�|Š|Ü # D§I¡I¨t¯{©{Ó ;ò)‘H�B˜Ø—N‘N 4Õ(ð)à×,Ñ,ò
�Ø— ‘ •
ñ
ð×,Ñ,ò
#�Ø× Ñ Õ"ñ
#ùò9@s
�J:©J:N) r0r1r2r3r ršrŸrÈrqr4r!rr~r~¯s,„ñ"ðH15¸eÈDô òDò!ò Oó#r!r~c󿇗eZdZ d ˆfd„ Zˆfd„Zd„Zd„Zd„Zd„Zd„Z d„Z
d „Z d
„Z d „Z
d „Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zed„«Zd„Zd„Zd„Z d„Z!d„Z"ˆxZ#S)!Ú_SelectorWidgetcóΕ—t‰|�|«d|_|€ d„|_n||_|xr|jj
|_|j«tddddd¬«|_ |jj|xsi«||_ d|_ t|t«r |g|_n||_d |_d|_d|_d|_t)«|_y)
NTcó—yrr4)Úargss rrPz*_SelectorWidget.__init__.<locals>.<lambda><ó�r!ú ÚescapeÚshiftÚcontrolrÕ)ÚmoverÈÚsquarerjÚrotateF)rsr Ú_visibleÚonselectrOrwrgÚconnect_default_eventsr�Ú_state_modifier_keysr§Ú_use_data_coordinatesrvr»rÚ validButtonsÚ_selection_completedÚ _eventpressÚ
_eventreleaseÚ _prev_eventrëÚ_state)rrIr¦rgrÚstate_modifier_keysÚuse_data_coordinatesr…s €rr z_SelectorWidget.__init__6sÚø€ä
‰Ñ˜ÔàˆŒ
Ø Ð Ù.ˆD�Mà$ˆDŒMØÒ< 4§;¡;×#<Ñ#<ˆŒ Ø ×#Ñ#Ô%ä$(¨c¸Ø07À Ø03ô%5ˆÔ!ð
×!Ñ!×(Ñ(Ð)<Ò)BÀÔCØ%9ˆÔ"àˆŒä �fœhÔ 'Ø!' ˆDÕ à &ˆDÔ ð%*ˆÔ!ð ˆÔà!ˆÔ؈ÔÜ“eˆ� r!cóL•—t‰|�|«|r|jd«yyr)rsr;Úupdate_background)rr:r…s €rr;z_SelectorWidget.set_activeYs&ø€Ü
‰Ñ˜6Ô"Ù Ø × "Ñ " 4Õ (ð r!cóx‡—tˆfd„‰jj«j«D««S)aG
Convenience method to get all animated artists of the figure containing
this widget, excluding those already present in self.artists.
The returned tuple is not sorted by 'z_order': z_order sorting is
valid only when considering all artists and not only a subset of all
artists.
c3óˆ•K—|]9}|j«D]$}|j«r|‰jvr|–—Œ&Œ;y­wr)Ú get_childrenÚ get_animatedÚartists)r‚Úax_Úars €rrƒz8_SelectorWidget._get_animated_artists.<locals>.<genexpr>fsLøèø€òD˜3Ø!×.Ñ.Ó0òDØØŸ™Ô(¨Q°d·l±lÑ-BôðD�QñDùsƒ?A)ÚtuplerIrNÚget_axesrs`rÚ_get_animated_artistsz%_SelectorWidget._get_animated_artists^s8ø€ôóD $§'¡'×"4Ñ"4Ó"6×"?Ñ"?Ó"AôDóDð Dr!cóB—|jsy|jj«ryt|j|j «zd„¬«}t
d„|D««}t«5}|rB|D]#}|j|jd¬««Œ%|jj«|jj|jj«|_ddd«|r#|D]}|jj|«Œyy#1swYŒ/xYw)z"Force an update of the background.Ncó"—|j«Sr©Ú
get_zorder©rºs rrPz3_SelectorWidget.update_background.<locals>.<lambda>zs € q§|¡|£~€r!©rc3ó<K—|]}|j«–—Œy­wr)Ú get_visible)r‚Úartists rrƒz4_SelectorWidget.update_background.<locals>.<genexpr>{sèø€ÒF°F˜6×-Ñ-×/ÑFùs‚F)rå)rgrOr—Úsortedr¸r½rÏrrÚ_cm_setr”r˜rIr“rvr‘)rrAr¸Ú needs_redrawrrÆs rr³z!_SelectorWidget.update_backgroundjsú€ð�|Š|Ø Ø �;‰;× Ñ Ô "Ø ô˜Ÿ™¨×(BÑ(BÓ(DÑDÙ5ô7ˆäÑF¸gÔFÓFˆ Ü
‹[ð G˜EÙØ%òG�FØ×'Ñ'¨¯©¸u¨Ó(EÕFðGà— ‘ × Ñ Ô"Ø"Ÿk™k×8Ñ8¸¿¹¿¹ÓFˆDŒO÷  Gñ Ø!ò
,�Ø—‘×#Ñ# FÕ+ñ
,ð ÷
 Gð Gús
Á.A9DÄDcóŒ—|jd|j«|jd|j«|jd|j«|jd|j«|jd|j
«|jd|j «|jd|j«y) z+Connect the major canvas events to methods.rrrprqrræÚkey_release_eventÚ scroll_eventN)rVrqÚpressr*r³Ú on_key_pressÚon_key_releaseÚ on_scrollrs rr§z&_SelectorWidget.connect_default_events†s™€à ×ÑÐ0°$·+±+Ô>Ø ×ÑÐ/°·±Ô<Ø ×ÑÐ1°4·<±<Ô@Ø ×ј<¨×)?Ñ)?Ô@Ø ×ÑÐ,¨d×.?Ñ.?Ô@Ø ×ÑÐ.°×0CÑ0CÔDØ ×ј>¨4¯>©>Õ:r!có2—|jr|jj«sy|jjj |«syt
|d«sd|_|j�|j|jvry|j€|jj|«d S|j|jjk(ry|jj|«d xs#|j|jjk7S)NTrrF) r:rIrÅrOr{r$rôrrªr¬rˆr@s rrBz_SelectorWidget.ignore�sê€à�{Š{ $§'¡'×"5Ñ"5Ô"7Øà�{‰{×%Ñ%×/Ñ/°Ô5ØÜ�u˜hÔ'؈EŒLð
× Ñ Ð )Ø—L‘L¨×(9Ñ(9Ñ9Øà × Ñ Ð #Ø—w‘w×'Ñ'¨Ó.¨qÑ1Ð1Ð 1à �<‰<˜4×+Ñ+×2Ñ2Ò 2Øà—G‘G×$Ñ$ UÓ+¨AÑ.Ð.ò8Ø— ‘  × 0Ñ 0× 7Ñ 7Ñ7ð 9r!cóV—|jj«r*|jjd¬«j«€y|jr¾|j
�&|j j|j
«n|jd«t|j|j«zd„¬«}|D]}|jj|«Œ|j j|jj«y|j j«y)z@Draw using blit() or draw_idle(), depending on ``self.useblit``.TrLNcó"—|j«SrrÀrÂs rrPz(_SelectorWidget.update.<locals>.<lambda>¶s €¨1¯<©<«>€r!rÃ)rIrÅrNrùrgrvrOr»r³rÇr¸r½r‘r’r“r)rr¸rÆs rr§z_SelectorWidget.update¨sÙ€à—‘×#Ñ#Ô%Ø—‘×"Ñ"¨Ð"Ó-×;Ñ;Ó=ÐEØ Ø �<Š<Ø�‰Ð*Ø— ‘ ×*Ñ*¨4¯?©?Õ;à×&Ñ& tÔ,ô˜TŸ\™\¨D×,FÑ,FÓ,HÑHÙ!9ô;ˆGà!ò
,�Ø—‘×#Ñ# FÕ+ð
,à �K‰K× Ñ ˜TŸW™WŸ\™\Õ *à �K‰K× !Ñ !Õ #r!có—|j€y|j|«\}}tj|g|jj «¢­Ž}tj|g|jj
«¢­Ž}||fS)z/Get the xdata and ydata for event, with limits.)NN)r]rdrÆÚcliprIrtrrr|s rÚ _get_dataz_SelectorWidget._get_data½sm€à �;‰;Ð ØØ×,Ñ,¨UÓ3‰ ˆˆuÜ—‘˜Ð5 §¡× 2Ñ 2Ó 4Ò5ˆÜ—‘˜Ð5 §¡× 2Ñ 2Ó 4Ò5ˆØ�eˆ|Ðr!có¬—|j€
|j}ntj|«}|j|«\|_|_||_|S)a
Preprocess an event:
- Replace *event* by the previous event if *event* has no ``xdata``.
- Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes
limits.
- Update the previous event.
)r]r®ÚcopyrÖr^r@s rÚ _clean_eventz_SelectorWidget._clean_eventÆsK€ð �;‰;Ð Ø×$Ñ$‰Eä—I‘I˜eÓ$ˆEØ#'§>¡>°%Ó#8Ñ ˆŒ �U”[Ø ˆÔ؈ r!có&—|j|«s€|j|«}||_||_|jxsd}|j dd«}||j dk(r|jjd«|j|«yy)z#Button press handler and validator.r/Úctrlr¡r¢TF)
rBrÙr¬r®rÚreplacer¨r¯ÚaddÚ_press)rrArs rrÍz_SelectorWidget.press×s€€à�{‰{˜5Ô!Ø×%Ñ% eÓ,ˆEØ$ˆDÔ Ø$ˆDÔ Ø—)‘)’/˜rˆCØ—+‘+˜f iÓ0ˆCà�d×/Ñ/°Ñ7Ò7Ø— ‘ —‘ Ô'Ø �K‰K˜Ô ØØr!có—y)úButton press event handler.Nr4r@s rrÞz_SelectorWidget._pressær�r!cóä—|j|«s_|jrS|j|«}||_|j |«d|_d|_|j
j
d«yy)z+Button release event handler and validator.Nr¢TF)rBr¬rÙr­r|r¯Údiscardr@s rr*z_SelectorWidget.releaseésb€à�{‰{˜5Ô! d×&6Ò&6Ø×%Ñ% eÓ,ˆEØ!&ˆDÔ Ø �M‰M˜%Ô Ø#ˆDÔ Ø!%ˆDÔ Ø �K‰K× Ñ  Ô 'ØØr!có—y)úButton release event handler.Nr4r@s rr|z_SelectorWidget._releaseõr�r!có„—|j|«s/|jr#|j|«}|j|«yy)ú(Cursor move event handler and validator.TF)rBr¬rÙÚ_onmover@s rrqz_SelectorWidget.onmoveøs8€à�{‰{˜5Ô! d×&6Ò&6Ø×%Ñ% eÓ,ˆEØ �L‰L˜Ô ØØr!có—y)úCursor move event handler.Nr4r@s rrçz_SelectorWidget._onmove r�r!cóJ—|j|«s|j|«yy)z)Mouse scroll event handler and validator.N)rBÚ
_on_scrollr@s rrÐz_SelectorWidget.on_scroll s€à�{‰{˜5Ô!Ø �O‰O˜EÕ "ð"r!có—y)zMouse scroll event handler.Nr4r@s rrëz_SelectorWidget._on_scroll r�r!có—|jró|jxsd}|jdd«}||jdk(r|j «y|jj «D]\}}||j
d«vsŒ|dk(rF||jvr|jj|«ŒI|jj|«Œe|jj|«Œ�|j|«yy)z@Key press event handler and validator for all selection widgets.r/rÛr¡rÈNú+r¤) r:rrÜr¨rÈr÷Úsplitr¯rârÝÚ
_on_key_press©rrArr¶Úmodifiers rrÎz_SelectorWidget.on_key_press sÕ€à �;Š;Ø—)‘)’/˜rˆCØ—+‘+˜f iÓ0ˆCØ�d×/Ñ/°Ñ8Ò8Ø—
‘
” ØØ%)×%>Ñ%>×%DÑ%DÓ%Fò
/Ñ!�˜Ø˜sŸy™y¨›~Ò-ð Ò(Ø  D§K¡KÑ/Ø ŸK™K×/Ñ/°Õ6à ŸK™KŸO™O¨EÕ2àŸ ™ Ÿ™¨Õ.ð
/ð
× Ñ ˜uÕ %ð# r!có—y)z@Key press event handler - for widget-specific key press actions.Nr4r@s rrðz_SelectorWidget._on_key_press r�r!có—|jry|jxsd}|jj«D]:\}}||j d«vsŒ|dk7sŒ |j
j
|«Œ<|j|«yy)z(Key release event handler and validator.r/rîr¤N)r:rr¨r÷rïr¯râÚ_on_key_releaserñs rrÏz_SelectorWidget.on_key_release# sy€à �;Š;Ø—)‘)’/˜rˆCØ%)×%>Ñ%>×%DÑ%DÓ%Fò
/Ñ!�˜ð˜sŸy™y¨›~Ò-°%¸8Ó2CØ—K‘K×'Ñ'¨Õ.ð 
/ð
× Ñ  Õ 'ð r!có—y)úKey release event handler.Nr4r@s rrõz_SelectorWidget._on_key_release. r�r!cóV—||_|jD]}|j|«Œy)z+Set the visibility of the selector artists.N)r¥r¸rÅ)rrårÆs rrÅz_SelectorWidget.set_visible1 s*€àˆŒ
Ø—l‘lò (ˆFØ × Ñ ˜wÕ 'ñ (r!có—|jS)z+Get the visibility of the selector artists.)r¥rs rrÅz_SelectorWidget.get_visible7 s €à�}‰}Ðr!cóD—|j«|j«y)zAClear the selection and set the selector ready to make a new one.N)Ú_clear_without_updater§rs rrÈz_SelectorWidget.clear; s€à ×"Ñ"Ô$Ø � ‰ �
r!có4—d|_|jd«y©NF)r«rÅrs rrûz%_SelectorWidget._clear_without_update@ s€Ø$)ˆÔ!Ø ×јÕr!có<—t|dd«}|jf|zS)z%Tuple of the artists of the selector.Ú_handles_artistsr4)rÚ_selection_artist)rÚhandles_artistss rr¸z_SelectorWidget.artistsD s'€ô" $Ð(:¸BÓ?ˆØ×&Ñ&Ð(¨?Ñ:Ð:r!c ó¦—|j}tj||«}|jdi|¤Ž|jr|j «yy)z¨
Set the properties of the selector artist.
See the *props* argument in the selector docstring to know which properties are
supported.
Nr4)rr rirërgr§)rrorÆs rÚ set_propsz_SelectorWidget.set_propsJ sG€ð×'Ñ'ˆÜ×&Ñ& u¨fÓ5ˆØˆ�
‰
Ñ�UÒØ �<Š<Ø �K‰K�Mð r!c ó0—t|d«s td«‚|jd}tj||«}|jD]}|j
di|¤ŽŒ|j r|j«|jj|«y)z¶
Set the properties of the handles selector artist. See the
`handle_props` argument in the selector docstring to know which
properties are supported.
rÿz#This selector doesn't have handles.rNr4) rôÚNotImplementedErrorrÿr rirërgr§Ú
_handle_props)rÚ handle_propsrÆrYs rÚset_handle_propsz _SelectorWidget.set_handle_propsW s‡€ô �tÐ/Ô0Ü%Ð&KÓLÐ Là×&Ñ& qÑ)ˆÜ×-Ñ-¨l¸FÓCˆ Ø×+Ñ+ò 'ˆFØ ˆF�J‰JÑ &˜Ó &ð 'à �<Š<Ø �K‰KŒMØ ×Ñ×!Ñ! ,Õ/r!cóª—|jj«D��cgc]\}}|dk7r|dk7r|‘Œ}}}tj||¬«ycc}}w)NrÈúnot-applicablerµ)r¨r÷rr­)rr¶rÚvalueÚsupported_states rÚ_validate_statez_SelectorWidget._validate_stateh sX€à"&×";Ñ";×"AÑ"AÓ"C÷Ù�C˜Ø�gŠ~ %Ð+;Ò";ò
ðˆñô
×ј?°%Ö8ùó sžAcó\—|j|«|jj|«y)a 
Add a state to define the widget's behavior. See the
`state_modifier_keys` parameters for details.
Parameters
----------
state : str
Must be a supported state of the selector. See the
`state_modifier_keys` parameters for details.
Raises
------
ValueError
When the state is not supported by the selector.
N)r
r¯rÝ©rr¶s rÚ add_statez_SelectorWidget.add_stateo s"€ð"
×јUÔ#Ø � ‰ �‰˜Õr!có\—|j|«|jj|«y)a£
Remove a state to define the widget's behavior. See the
`state_modifier_keys` parameters for details.
Parameters
----------
state : str
Must be a supported state of the selector. See the
`state_modifier_keys` parameters for details.
Raises
------
ValueError
When the state is not supported by the selector.
N)r
r¯r[rs rÚ remove_statez_SelectorWidget.remove_stateƒ s$€ð"
×јUÔ#Ø � ‰ ×ј5Õ!r!)NFNNF)$r0r1r2r r;r½r³r§rBr§rÖrÙrÍrÞr*r|rqrçrÐrërÎrðrÏrõrÅrÅrÈrûrEr¸rrr
rrr¢r£s@rr™r™4s¶ø„à@DØ@Eõ!ôF)ò
Dò,ò8;ò9ò0$ò*òò"
ò*ò
ò,òò)ò#ò
*ò&ò*Oò (ò)ò(ò òò
 ðñ;óð;ò
ò0ò"9òö("r!r™c
ó‡—eZdZdZdddddddddddddœ ˆfd„
Zdddœd „Zd
„Zed „«Zd „Z ˆfd
„Z
d„Z ed„«Z e jd„«Z d„Zd„Zd„Zd„Zd„Zd„Zed„«Zed„«Zejd„«Zd„ZˆxZS)Ú SpanSelectoraù
Visually select a min/max range on a single axis and call a function with
those values.
To guarantee that the selector remains responsive, keep a reference to it.
In order to turn off the SpanSelector, set ``span_selector.active`` to
False. To turn it back on, set it to True.
Press and release events triggered at the same coordinates outside the
selection will clear the selector, except when
``ignore_event_outside=True``.
Parameters
----------
ax : `~matplotlib.axes.Axes`
onselect : callable with signature ``func(min: float, max: float)``
A callback function that is called after a release event and the
selection is created, changed or removed.
direction : {"horizontal", "vertical"}
The direction along which to draw the span selector.
minspan : float, default: 0
If selection is less than or equal to *minspan*, the selection is
removed (when already existing) or cancelled.
useblit : bool, default: False
If True, use the backend-dependent blitting features for faster
canvas updates. See the tutorial :ref:`blitting` for details.
props : dict, default: {'facecolor': 'red', 'alpha': 0.5}
Dictionary of `.Patch` properties.
onmove_callback : callable with signature ``func(min: float, max: float)``, optional
Called on mouse move while the span is being selected.
interactive : bool, default: False
Whether to draw a set of handles that allow interaction with the
widget after it is drawn.
button : `.MouseButton` or list of `.MouseButton`, default: all buttons
The mouse buttons which activate the span selector.
handle_props : dict, default: None
Properties of the handle lines at the edges of the span. Only used
when *interactive* is True. See `.Line2D` for valid properties.
grab_range : float, default: 10
Distance in pixels within which the interactive tool handles can be activated.
state_modifier_keys : dict, optional
Keyboard modifiers which affect the widget's behavior. Values
amend the defaults, which are:
- "clear": Clear the current shape, default: "escape".
drag_from_anywhere : bool, default: False
If `True`, the widget can be moved by clicking anywhere within its bounds.
ignore_event_outside : bool, default: False
If `True`, the event triggered outside the span selector will be ignored.
snap_values : 1D array-like, optional
Snap the selector edges to the given values.
Examples
--------
>>> import matplotlib.pyplot as plt
>>> import matplotlib.widgets as mwidgets
>>> fig, ax = plt.subplots()
>>> ax.plot([1, 2, 3], [10, 50, 100])
>>> def onselect(vmin, vmax):
... print(vmin, vmax)
>>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
... props=dict(facecolor='blue', alpha=0.5))
>>> fig.show()
See also: :doc:`/gallery/widgets/span_selector`
rFNrß) ÚminspanrgroÚonmove_callbackÚ interactiverrÚ
grab_ranger°Údrag_from_anywhereÚignore_event_outsideÚ snap_valuesc ó•—| €tdddd¬«} t‰|� |||| | ¬«|€
tdd¬«}|j|d<||_d|_||_||_||_| |_ ||_
d|_ |
|_ ||_
|j||d ¬
«d |jd d
«it!j"|
t$«¥|_|jr$ddg|_|j+|j&«d|_y)NrŸr
)rÈr£rjr¤)rgrr°Úredri)ráÚalphar~T©Ú_propsÚ_initr‚rárÕrFrJ)r�rsr rgÚ directionÚ_extents_on_pressrrrrÚ _interactiveÚ
_edge_handlesrrÚnew_axesrŠr rirrÚ _edge_orderÚ_setup_edge_handlesr8)rrIr¦r"rrgrorrrrrr°rrrr…s €rr zSpanSelector.__init__ë s&ø€ð Ð &Ü"&¨XØ.>Ø.>Ø.>ô#@Ð ô ‰Ñ˜˜X¨w¸vØ-@ð ô Bð ˆ=Ü 5°Ô4ˆEà ŸL™LˆˆjÑà"ˆŒØ!%ˆÔØ&ˆÔà.ˆÔ؈Œ à$ˆŒØ'ˆÔØ!ˆÔØ"4ˆÔØ$8ˆÔ!à �
‰
�b ¨dˆ
Ô3ð
�U—Y‘Y˜{¨CÓ0ð<ä×$Ñ$ \´6Ó:ð<ˆÔð × Ò Ø % u˜~ˆDÔ Ø × $Ñ $ T×%7Ñ%7Ô 8à"ˆÕr!rcó&—d}|s(|j|jd¬«jur|j�|j«d}||_|r|j «d|_|j dk(r|j«}d\}}n|j«}d\}}td|||d¬ «}|�|j|«n'|j�|j|j«|jj|«||_ y)
z*Set SpanSelector to operate on a new Axes.FTrLNr¨rß)rr©rr)rarå)rOrNrZrIr§r«r"r0r/rr§rÚ update_fromrù) rrIr r!Ú reconnectÚtransÚwrWÚ rect_artists rr&zSpanSelector.new_axes
sû€àˆ Ù �D—K‘K r§}¡}¸$ }Ó'?×'FÑ'FÑFØ�{‰{Ð&Ø×&Ñ&Ô(؈I؈ŒÙ Ø × 'Ñ 'Ô )ð%*ˆÔ!à �>‰>˜\Ò )Ø×*Ñ*Ó,ˆE؉DˆA‰qà×*Ñ*Ó,ˆE؉DˆAˆqÜ ¨¨1¸ÀuÔMˆ Ø Ð Ø × Ñ ˜vÕ &Ø
×
#Ñ
#Ð
/Ø × #Ñ # D×$:Ñ$:Ô ;à �‰×ј+Ô&Ø!,ˆÕr!cóò—|jdk(r|jj«}n|jj«}t |j||j||j
¬«|_y)Nr¨)r"Ú
line_propsrg)r"rIrtrrÚToolLineHandlesrgr%)rroÚ positionss rr(z SpanSelector._setup_edge_handles5
sY€à �>‰>˜\Ò )ØŸ™×*Ñ*Ó,‰IàŸ™×*Ñ*Ó,ˆIÜ,¨T¯W©W°iØ7;·~±~Ø8=Ø59·\±\ôCˆÕr!cóH—|j�|jjSyrh)r%r¸rs rrÿzSpanSelector._handles_artists@
s#€à × Ñ Ð )Ø×%Ñ%×-Ñ-Ð -àr!có.—|rD|jdk(rtjjntjj}ntjj
}|j jd¬«jj|«y)z<Update the canvas cursor based on direction of the selector.r¨TrLN)
r"r
ÚCursorsÚRESIZE_HORIZONTALÚRESIZE_VERTICALÚPOINTERrIrNrOÚ
set_cursor)rÚenabledrðs rÚ _set_cursorzSpanSelector._set_cursorG
so€á àŸ™¨<Ò7ô$×+Ñ+×=Ò=ä#×+Ñ+×;Ñ;ñ
ô#×*Ñ*×2Ñ2ˆFà �‰×Ñ ÐÓ%×,Ñ,×7Ñ7¸Õ?r!cóv•—t‰|�«t|dd«r|jd|j«yy)Nr$Frr)rsr§rrVÚ_hover)rr…s €rr§z#SpanSelector.connect_default_eventsR
s4ø€ä
‰Ñ&Ô(Ü �4˜¨Ô /Ø × Ñ Ð4°d·k±kÕ Bð 0r!cóØ—|jd«|jr,|jj«r|j |«nd|_|j
� |js|j
«|j|«\}}|jdk(r|n|}|j
€.|js"d|_
|j||f«d|_
y|jd«y)ràTNr¨F)
r<r$rrÅÚ_set_active_handler8r§rdr"rr¥Ú _set_extentsrÅ)rrAr]r^rs rrÞzSpanSelector._pressX
sÓ€à ×Ñ˜ÔØ × Ò  ×!7Ñ!7×!CÑ!CÔ!EØ × #Ñ # EÕ *à"&ˆDÔ à × Ñ Ð &¨d×.?Ò.?à �K‰KŒMà×,Ñ,¨UÓ3‰ ˆˆuØ—^‘^ |Ò3‰E¸ˆà × Ñ Ð &¨t×/HÒ/Hð"ˆDŒMØ × Ñ ˜q !˜fÔ %ð!ˆDŒMðð
× Ñ ˜TÔ "àr!có—|jS)z;Direction of the span selector: 'vertical' or 'horizontal'.©Ú
_directionrs rr"zSpanSelector.directionu
ó€ð�‰Ðr!có�—tjddg|¬«t|d«rš||jk7r‹|jj «|j r|jj «||_|j|j«|j r|j|j«yy||_y)z'Set the direction of the span selector.r¨r©©r"rDN) rr­rôrDrr[r$r%r&rIr(r)rr"s rr"zSpanSelector.directionz
s�€ô
×јL¨*Ð5ÀÕKÜ �4˜Ô &¨9¸¿¹Ò+Gà × "Ñ "× )Ñ )Ô +Ø× Ò Ø×"Ñ"×)Ñ)Ô+Ø'ˆDŒOØ �M‰M˜$Ÿ'™'Ô "Ø× Ò Ø×(Ñ(¨×);Ñ);Õ<ð!ð(ˆD�Or!cóÒ—|jd«|js|jjd«|j€|j
r
|j ry|j\}}||z
}||jkr7|jd«|j
r|j||«d|_n|j||«d|_|j«d|_y)räFNT) r<r$rrÅr8r«rÚextentsrr¦r§)rrArArBÚspans rr|zSpanSelector._releaseŠ
sÆ€à ×јÔà× Ò Ø × "Ñ "× .Ñ .¨uÔ 5à × Ñ Ð '¨D×,EÒ,EØ×)Ò)Ø à—\‘\‰
ˆˆdØ�d‰{ˆà �4—<‘<Ò à × Ñ ˜UÔ #Ø×(Ò(à—
‘
˜d DÔ)Ø(-ˆDÕ %à �M‰M˜$ Ô %Ø(,ˆDÔ %à � ‰ Œ
à"ˆÔàr!cóü—|j|«ry|j€ |jsy|jj |j
|j «\}}|j||jk«y)z/Update the canvas cursor if it's over a handle.N) rBr8r«r%Úclosestrbrcr<r)rrArÚe_dists rr>zSpanSelector._hover©
se€à �;‰;�uÔ Ø à × Ñ Ð *°$×2KÒ2Kð
à×&Ñ&×.Ñ.¨u¯w©w¸¿¹Ó@‰ ˆˆ6Ø ×ј 4§?¡?Ñ2Õ3r!cóL—|j|«\}}|jdk(r|}|jj}n|}|jj}|j
dk(r+|j �|j \}}||z
}||z
}||z
}ne|j
r3|j
dk7r$|j \}}|j
dk(r|}n)|}n&|jr
|jry||}}||kDr||}}|j||f«|j�|j||«y)zMotion notify event handler.r¨ÚCNrFF) rdr"r¬r]r^r8r#rr«rAr) rrAr]r^rÚvpressrArBÚdvs rrçzSpanSelector._onmove¸
s4€ð×,Ñ,¨UÓ3‰ ˆˆuØ �>‰>˜\Ò )؈AØ×%Ñ%×+Ñ+‰FàˆAØ×%Ñ%×+Ñ+ˆFð
× Ñ  #Ò %¨$×*@Ñ*@Ð*LØ×/Ñ/‰JˆD�$Ø�V‘ˆBØ �B‰JˆDØ �B‰J‰Dð×
Ò
 T×%8Ñ%8¸CÒ%?Ø×/Ñ/‰JˆD�$Ø×"Ñ" eÒ+Ø‘à‘ð
×(Ò(¨T×-FÒ-FØØ �$ˆDØ�dŠ{Ø! 4�d�à ×ј4 ˜,Ô'à × Ñ Ð +Ø × Ñ   tÔ ,àr!có—||kDr||}}|jdk(r:|jj|«|jj||z
«y|jj |«|jj ||z
«y)Nr¨)r"rÚset_xrÚset_yr©rrArBs rÚ _draw_shapezSpanSelector._draw_shapeä
sv€Ø �$Š;ؘt�$ˆDØ �>‰>˜\Ò )Ø × "Ñ "× (Ñ (¨Ô .Ø × "Ñ "× ,Ñ ,¨T°D©[Õ 9à × "Ñ "× (Ñ (¨Ô .Ø × "Ñ "× -Ñ -¨d°T©kÕ :r!cóˆ—|jj|j|j«\}}d|jvrd|_nh||j kDrEd|_|jr*|j|«rd|_|j|_
nd|_y|j||_|j|_
y)ú;Set active handle based on the location of the mouse event.r¢rON) r%rLrbrcr¯r8rrÚ _containsrIr#r')rrAÚe_idxrMs rr@zSpanSelector._set_active_handleî
s¨€ð×*Ñ*×2Ñ2°5·7±7¸E¿G¹GÓD‰
ˆˆvð �T—[‘[Ñ Ø"%ˆDÕ Ø
�d—o‘oÒ
%à"&ˆDÔ Ø×&Ò&¨4¯>©>¸%Ô+@à&)�Ô#Ø)-¯©�Õ&à&*�Ô#Øð#'×"2Ñ"2°5Ñ"9ˆDÔ ð"&§¡ˆÕr!cóB—|jj|d¬«dS©z)Return True if event is within the patch.r)Úradius©rrˆr@s rrYzSpanSelector._contains ó#€à×%Ñ%×.Ñ.¨u¸QÐ.Ó?ÀÑBÐBr!c󬇇—tjtjtj‰«««dzŠt ˆˆfd„|D««S)z2Snap values to a given array values (snap_values).gê-�™—q=c3ó¢•K—|]F}‰tj‰|z
tj|«‰zz«j«–—ŒHy­wr)rÆrÊÚsignrÉ)r‚rÚepsrs €€rrƒz%SpanSelector._snap.<locals>.<genexpr> sFøèø€òàð
œŸ™˜{¨Q™´·±¸³¸cÑ1AÑAÓB×IÑIÓKÕ LñùsƒA A)rÆrFrÊÚdiffr»)Úvaluesrrcs `@rÚ_snapzSpanSelector._snap sDù€ô�f‰f”R—V‘VœBŸG™G KÓ0Ó1Ó2°UÑ:ˆÜôàôóð r!có —|jdk(r;|jj«}||jj«z}||fS|jj «}||jj «z}||fS)zå
(float, float)
The values, in data coordinates, for the start and end points of the current
selection. If there is no selection then the start and end values will be
the same.
r¨)r"rrÚ get_widthrÚ
get_heightrUs rrIzSpanSelector.extents s‚€ð �>‰>˜\Ò )Ø×)Ñ)×/Ñ/Ó1ˆDؘ$×0Ñ0×:Ñ:Ó<Ñ<ˆDð�TˆzÐð×)Ñ)×/Ñ/Ó1ˆDؘ$×0Ñ0×;Ñ;Ó=Ñ=ˆDØ�TˆzÐr!có4—|j|«d|_y©NT)rAr«©rrIs rrIzSpanSelector.extents% s€à ×ј'Ô"Ø$(ˆÕ!r!có<—|j�%t|j||j««}|j|Ž|jr%|j
j
|j«|j|j«|j«yr) rr»rfrVr$r%Úset_datarIrÅr¥r§rls rrAzSpanSelector._set_extents* su€à × Ñ Ð 'ܘDŸJ™J w°×0@Ñ0@ÓAÓBˆG؈×ј'Ñ"Ø × Ò à × Ñ × 'Ñ '¨¯ © Ô 5Ø ×јŸ™Ô'Ø � ‰ �
r!)r0r1r2r3r r&r(rErÿr<r§rÞr"rJr|r>rçrVr@rYÚ staticmethodrfrIrAr¢r£s@rrr˜ sùø„ñPðd<=ÀeبT¸uب4¸BØ%)¸eØ&+¸ö +#ðZ&*°ô-ò: Cðñóðò @ôCò ð:ñóðð×Ññ
(óð
(òò>
4ò*òX;ò.ò4Cðñóððñ
óð
ð
‡^�^ñ)óð)ö r!rcól—eZdZdZdddœd„Zed„«Zed„«Zed„«Zd „Z d
„Z
d „Z d „Z d
„Z
y)r2a`
Control handles for canvas tools.
Parameters
----------
ax : `~matplotlib.axes.Axes`
Matplotlib Axes where tool handles are displayed.
positions : 1D array
Positions of handles in data coordinates.
direction : {"horizontal", "vertical"}
Direction of handles, either 'vertical' or 'horizontal'
line_props : dict, optional
Additional line properties. See `.Line2D`.
useblit : bool, default: True
Whether to use blitting for faster drawing (if supported by the
backend). See the tutorial :ref:`blitting`
for details.
NT)r1rgcóü—||_tjddg|¬«||_i|�|ni¥d|dœ¥}|jdk(r |j
n |j }|D�cgc] }||fi|¤Ž‘Œ
c}|_ycc}w)Nr¨r©rGF)rår~)rIrr­rDr"rÿrüÚ_artists)rrIr3r"r1rgÚline_funÚps rr zToolLineHandles.__init__J s�€àˆŒä ×јL¨*Ð5ÀÕKØ#ˆŒð
Ø'Ð3‰z¸ð
àØò
ˆ
ð "&§¡°<Ò!?�2—:’:ÀRÇZÁZˆà<EÖF°q™ !Ñ2 zÓ2ÒFˆ�
ùÒFsÁ A9có,—t|j«Sr)r»rrrs rr¸zToolLineHandles.artists[ s€ä�T—]‘]Ó#Ð#r!cóŠ—|jdk(rdnd}|jD�cgc]}t||««d‘Œc}Scc}w)z,Positions of the handle in data coordinates.r¨rUrVr)r"r¸r)rÚmethodr—s rr3zToolLineHandles.positions_ s@€ð!%§¡°,Ò >‘ÀKˆØ7;·|±|ÖD¨tÐ%”˜˜fÓ%Ó'¨Ó*ÒDÐDùÒDs¢Acó—|jS)z4Direction of the handle: 'vertical' or 'horizontal'.rCrs rr"zToolLineHandles.directione rEr!cóŽ—|jdk(rdnd}t|j|«D]\}}t||«||g«Œy)zþ
Set x- or y-positions of handles, depending on if the lines are
vertical or horizontal.
Parameters
----------
positions : tuple of length 2
Set the positions of the handle in data coordinates
r¨rrN)r"r…r¸r)rr3rwr—rts rrnzToolLineHandles.set_dataj sI€ð!%§¡°,Ò >‘ÀKˆÜ˜4Ÿ<™<¨Ó3ò *‰GˆD�!Ø !ŒG�D˜&Ó ! 1 a &Õ )ñ *r!cóH—|jD]}|j|«Œy)z/Set the visibility state of the handles artist.N)r¸rÅ©rr rÆs rrÅzToolLineHandles.set_visiblex s#€à—l‘lò &ˆFØ × Ñ ˜uÕ %ñ &r!cóH—|jD]}|j|«Œy)z-Set the animated state of the handles artist.N)r¸Ú set_animatedr{s rr}zToolLineHandles.set_animated} s#€à—l‘lò 'ˆFØ × Ñ  Õ &ñ 'r!cóF—|jD]}|j«Œy)z*Remove the handles artist from the figure.N)rrr[)rrÆs rr[zToolLineHandles.remove‚ s€à—m‘mò ˆFØ �M‰M�Oñ r!c óú—|jdk(rdtj|jD�cgc],}|jj
j
|df«d‘Œ.c}«}t||z
«}nctj|jD�cgc],}|jj
j
d|f«d‘Œ.c}«}t||z
«}tj|«}|||fScc}wcc}w)ar
Return index and pixel distance to closest handle.
Parameters
----------
x, y : float
x, y position from which the distance will be calculated to
determinate the closest handle
Returns
-------
index, distance : index of the handle and its distance from
position x, y
r¨rr) r"rÆr.r3rIr_rarÊrÉ)rrbrcrtÚp_ptsÚdistr½s rrLzToolLineHandles.closest‡ sÚ€ð �>‰>˜\Ò )Ü—H‘HØ@DÇÁöØ;<�—‘×!Ñ!×+Ñ+¨Q°¨FÓ3°AÓ6òóˆEô�u˜q‘y“>‰Dä—H‘HØ@DÇÁöØ;<�—‘×!Ñ!×+Ñ+¨Q°¨FÓ3°AÓ6òóˆEô�u˜q‘y“>ˆDÜ— ‘ ˜$“ˆØ�d˜5‘kÐ!Ð!ùòùò
s ­1C3Â1C8)r0r1r2r3r rEr¸r3r"rnrÅr}r[rLr4r!rr2r26 sn„ñð&@DØôGð"ñ$óð$ðñEóðEð
ñóðò *ò&ò
'ò
ó
"r!r2cój—eZdZdZddddœd„Zed„«Zed„«Zed „«Zdd
„Z d „Z
d „Z d
„Z y)Ú ToolHandlesaO
Control handles for canvas tools.
Parameters
----------
ax : `~matplotlib.axes.Axes`
Matplotlib Axes where tool handles are displayed.
x, y : 1D arrays
Coordinates of control handles.
marker : str, default: 'o'
Shape of marker used to display handle. See `~.pyplot.plot`.
marker_props : dict, optional
Additional marker properties. See `.Line2D`.
useblit : bool, default: True
Whether to use blitting for faster drawing (if supported by the
backend). See the tutorial :ref:`blitting`
for details.
r'NT©rär rgcóà—||_|dddddddœtj|tj«¥}t||fd|i|¤Ž|_|jj
|j
«y) Nér.rzriFÚ
_nolegend_)räÚ
markersizeÚmarkerfacecolorÚ linestylerrårvr~)rIr rirÚ
_alias_mapÚ_markersÚadd_line)rrIrbrcrär rgros rr zToolHandles.__init__¸ sp€ØˆŒØ!°ÀsØ$¨s¸uØ&ñLô×)Ñ)¨,¼×8IÑ8IÓJðLˆô˜q !Ñ?¨gÐ?¸Ñ?ˆŒ
Ø �‰×јŸ™Õ'r!có6—|jj«Sr)rŒrUrs rrbz
ToolHandles.xÁ ó€à�}‰}×&Ñ&Ó(Ð(r!có6—|jj«Sr)rŒrVrs rrcz
ToolHandles.yÅ r�r!có—|jfSr)rŒrs rr¸zToolHandles.artistsÉ s€à—
‘
Ð Ð r!cóp—|�|}tj||g«}|jj|«y)z!Set x and y positions of handles.N)rÆr.rŒrn)rÚptsrcrbs rrnzToolHandles.set_dataÍ s0€à ˆ=؈AÜ—(‘(˜A˜q˜6Ó"ˆCØ �
‰
×јsÕ#r!có:—|jj|«yr)rŒrÅr s rrÅzToolHandles.set_visibleÔ s€Ø �
‰
×!Ñ! #Õ&r!có:—|jj|«yr)rŒr}r s rr}zToolHandles.set_animated× s€Ø �
‰
×"Ñ" 3Õ'r!có —tj|j|jg«}|jj
j
|«}|||gz
}tj|jŽ}tj|«}|||fS)z1Return index and pixel distance to closest index.)
rÆÚ column_stackrbrcrIr_raÚhypotÚTrÉ)rrbrcr“rdr�Ú min_indexs rrLzToolHandles.closestÚ sr€ä�o‰o˜tŸv™v t§v¡vÐ.Ó/ˆà�g‰g×Ñ×)Ñ)¨#Ó.ˆØ�a˜�V‰|ˆÜ�x‰x˜Ÿ™Ð ˆÜ—I‘I˜d“Oˆ ؘ$˜y™/Ð)Ð)r!r)
r0r1r2r3r rErbrcr¸rnrÅr}rLr4r!rrƒrƒ¤ se„ñð&,/¸TÈ4ô(ðñ)óð)ðñ)óð)ðñ!óð!ó$ò'ò(ó*r!rƒu
Parameters
----------
ax : `~matplotlib.axes.Axes`
The parent Axes for the widget.
onselect : function, optional
A callback function that is called after a release event and the
selection is created, changed or removed.
It must have the signature::
def onselect(eclick: MouseEvent, erelease: MouseEvent)
where *eclick* and *erelease* are the mouse click and release
`.MouseEvent`\s that start and complete the selection.
minspanx : float, default: 0
Selections with an x-span less than or equal to *minspanx* are removed
(when already existing) or cancelled.
minspany : float, default: 0
Selections with an y-span less than or equal to *minspanx* are removed
(when already existing) or cancelled.
useblit : bool, default: False
Whether to use blitting for faster drawing (if supported by the
backend). See the tutorial :ref:`blitting`
for details.
props : dict, optional
Properties with which the __ARTIST_NAME__ is drawn. See
`.Patch` for valid properties.
Default:
``dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)``
spancoords : {"data", "pixels"}, default: "data"
Whether to interpret *minspanx* and *minspany* in data or in pixel
coordinates.
button : `.MouseButton`, list of `.MouseButton`, default: all buttons
Button(s) that trigger rectangle selection.
grab_range : float, default: 10
Distance in pixels within which the interactive tool handles can be
activated.
handle_props : dict, optional
Properties with which the interactive handles (marker artists) are
drawn. See the marker arguments in `.Line2D` for valid
properties. Default values are defined in ``mpl.rcParams`` except for
the default value of ``markeredgecolor`` which will be the same as the
``edgecolor`` property in *props*.
interactive : bool, default: False
Whether to draw a set of handles that allow interaction with the
widget after it is drawn.
state_modifier_keys : dict, optional
Keyboard modifiers which affect the widget's behavior. Values
amend the defaults, which are:
- "move": Move the existing shape, default: no modifier.
- "clear": Clear the current shape, default: "escape".
- "square": Make the shape square, default: "shift".
- "center": change the shape around its center, default: "ctrl".
- "rotate": Rotate the shape around its center between -45° and 45°,
default: "r".
"square" and "center" can be combined. The square shape can be defined
in data or display coordinates as determined by the