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!Gdde!«Z"Gdde"«Z#Gdde"«Z$Gdde$«Z%Gdde$«Z&dZ'Gdde"«Z(Gdde"«Z)Gdde"«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ó4eZdZdZdZdZdZdZdZdZ 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©Ú_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!à~‰~˜ ÜÐ ˆ 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!à~‰~˜ ÜÐ ˆ 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à{‰{˜Ð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%ñòòò ò  ó'r!rcóDeZdZdZdZdZdZdZdZe eed¬«Z
dZ 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ó:eZdZdZdZed«ZdZdZdZ 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)
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'àò *ˆ K‰K× &   *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Úyr@s rÚ_get_data_coordszAxesWidget._get_data_coords‰s]ð/4¯l©l¸d¿g¹gÑ.E˜eŸk™kÐ QØ—WW×&×1×;¸U¿W¹WÀeÇgÁgÐ<NÓ Qr!N)
r0r1r2r3r rErOrVrZrdr4r!rrGrG^s)ñò*ñÑ
H€Fòò
Qr!rGcóLeZdZdZ d
ddœˆfd ZdZdZdZdZd „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óXt||«||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
à?Ú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ÚimagerrgÚ __class__s €rr zButton.__init__§ø€ô, јÔà Ð Ø I‰I Ø—WW˜S # uØ/7Ø19Ø')§|¡|ðó5ˆŒ
ð
 Ò= D§K¡K×$=Ñ$=ˆŒ
ä×0¸)¸ÔŒà ×Ñз±Ô ×ÑÐ1°4·=±=Ô ×ÑÐ0°$·,±,Ô
˜ÔØ
×Ñ˜ÔØ
Ø
؈Œ
Ø$ˆ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Ø Ø <‰<× ¯©Ò 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Ø ;‰;  §¡×!;Ñ!;¸t¿w¹wÒ!FØ Ø
×" 4§7¡7Ô =Š=˜TŸW™W×-¨eÓ4°QÒ O‰O× # I¨uÕ 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ˆrr
Ú
same_colorÚ
get_facecolorrrCrxÚ draw_artistrOÚblitÚbboxÚdraw©rrArYs rr}zButton._motionáØ ;‰; Ø Ø#Ÿw™w×Ó6°qÒ9ˆDOŠO¸t¿z¹zˆÜ× Ñ   D§G¡G×$9Ñ$9Ó$;Ô G‰G× !  {Š{Ø—=—GGׯ©Ô—K$ T§W¡W§\¡\Õ—KK× ð=r!cóB|jjdˆfd«S)
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ÓLr!có:|jj|«y)z6Remove the callback function with connection id *cid*.N©rzÚ
disconnect©rrUs rzButton.disconnectöóà ×" 'r!)Nz0.85z0.95) r0r1r2r3r r{r|r}Ú
__classcell__©r…s@rrfrfs8ø„ñð$)-Ø*0ð+%Ø=Aö+%òZ  Mö(r!rfcó4eZdZdZˆfdZdZdZdZˆ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)
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´Údraggingr²Úaxisr…s €rr zSliderBase.__init__sˆø€à
7‰7dŠ?ÜÐ 
јÔÜ ×јL¨*Ð5À;Õ&ˆÔØ"ˆŒØŒØˆŒ ؈Œ ؈Œ Ø ˆÔ؈Œ à ˜*Ò K‰K˜ Ð —8‘8‰Dà K‰K˜ Ð —8‘8ˆDà׌ ܘ$Ÿ)™)¤V×%;Ñ%;Ô×0ˆDŒIØ I‰I× Ñ ˜tÔ  ‰ ×Ñ Ô ×! 
ÔØ
˜Ôà ×Ñз±Ô ×ÑÐ1°4·<±<Ô Ø × Ñ Ð4°d·l±lÔ ×0¸ÔEˆr!có¼t|jt«rA|jt ||jz
|jz «|jzz}|S|jtt 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ÚroundÚnpÚ
asanyarrayÚndimr%ÚargminÚabs)rÚvalr²s rÚ_stepped_valuezSliderBase._stepped_value*ä d—l‘l¤FÔ —;‘;ܘC $§+¡+Ñ·±ÑÇÁÑNˆCðˆ
ð\‰\Ð
—mm D§L¡LÓ1ˆGØ|‰|˜ Ü Ø<¸W¿\¹\¸NÐððœ"Ÿ)™)¤B§F¡F¨7°S©=Ó$9Ó;ˆˆ
r!có:|jj|«y)
Remove the observer with connection id *cid*.
Parameters
----------
cid : int
Connection id of the observer to be removed.
Nržr s rzSliderBase.disconnect8sð
×" 'r!có”tj|j|jk7«r|j |j«yy)z&Reset the slider to the initial value.N)ÚanyrËÚvalinitÚset_valrs rÚresetzSliderBase.resetCs0ä
6‰6$—((˜dŸl™lÑ L‰L˜ŸÕ  ,r!) r0r1r2r3r s@rûsø„ñô &FòP ò 'r!c
ó\eZdZdZdddddddddddddœ ˆfd „
Zd
Zd Zd Zd
ZdZ ˆ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´Ú sliderminÚ slidermaxrÂÚ initcolorÚ track_colorÚ handle_stylec ó¸t|||
|||||| | « | $t| d«stdt | «d«|
$t|
d«stdt |
«d«| |_|
|_|j|«}||}||_||_ dddd œ}|in|}i|¥|¥j«Dcic] \}}d
||Œ
}}}|
d k(rtd 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©raçè?r)rÚlwÚ clip_path©rr'Úclip_onFçR¸…ëQð?Úbottomrj©rarkrlç{®Gáz”¿ÚtopÚrightÚleft)rsr Úhasattrr%Útyper×Ú_value_in_boundsrËÚitemsrruÚtrackÚ add_patchÚaxhspanÚpolyÚaxhlinerÚhlineÚaxvspanÚaxvlineÚvlineÚplotÚ_handlerrvÚ_formatÚvaltextrÑ)rrIrvr´ÚkwargsÚdefaultsÚ marker_propsÚhandleXYr…s €rr zSlider.__init__Ws5ø€ôb ј˜[¨)°YØ ¨°¸7ô Dð Ð ¬°¸EÔ)BÜØ&¤t¨I£Ð&7°~ÐHð
Hà Ð ¬°¸EÔ)BÜØ&¤t¨I£Ð&7°~ÐHð
Hà"ˆŒØ"ˆŒØ×ÓØ ˆ?؈G؈ŒØˆŒ à!(°uÀbÑØ1‘r°|ˆ à(D¨8Ð(D°|Ð(D×(JÑ(JÓ(L÷
Ù $  1ˆfQCˆL˜!‰Oð
ˆ ñ
ð ˜ ˜"˜Ÿ,™,؈DŒJð
L‰L˜ŸÔ "˜Ÿ
 6¨7°C¸ÑÑGˆDŒIðŸ G¨Q°¸ÀqÜ.BÀ4Ç:Á:Ó.NðPˆDŒJà˜ ˜)‰Hä˜!˜RØŸ,™,؈DŒJð
L‰L˜ŸÔ "˜Ÿ
 6¨7°C¸ÑÑGˆDŒIØŸ G¨Q°¸ÀqÜ.BÀ4Ç:Á:Ó.NðPˆDŒJà ˜  C 5Ð)ˆHؘŸð
Ø
ð
à ò
ðñ
ðò 
ˆŒ ð ˜*Ò Ÿ  d¨E¸R¿\¹\Ø3;Ø5=ð?ˆDŒJðŸ7™7 ¨t¯|©|¸GÓ/DØ-/¯\©\Ø5:Ø7?ðAˆD
Ÿ ¨¨U¸b¿l¹lØ3;Ø5<ð>ˆDŒJðŸ7™7 ¨d¯l©l¸7Ó.CØ-/¯\©\Ø5=Ø7=ð?ˆDŒLð
ùó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)©rs rzSlider._value_in_boundsóà×! &ˆà $—+ Ø—>Ø—++‰CØ
D—K
Ø—>Ø—++ˆ >‰>Ð %¨#°·±×1CÑ1CÒ*CØ—>Ø—..×$ˆ >‰>Ð %¨#°·±×1CÑ1CÒ*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ˆrOrd)rrAr]r^s rzSlider._update sà ;‰;  §¡°Ò!2Ø à :‰:Ð -°$·'±'×2BÑ2BÀ5Ó2IÈ!Ò2LØ#ˆ Ø L‰L× # D§G¡GÔ ×ÒØ à J‰JÐ Ð3¸D¿G¹G×<LÑ<LÈUÓ<SÐTUÒ<VØ$ˆ Ø 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´Ú format_ticksr°Ú
get_offset)rÚss rrzSlider._format#s\à ;‰;Ð —;; Ñ —i‘i×,¨d¯k©k¸3ÀÇ Á Ð-LÓM‰GˆAˆqt—yy× -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
TrLN)Ú
set_heightÚget_yrÚ set_ydataÚ set_widthÚget_xÚ set_xdatarÚset_textrrCrIrNrOÚ draw_idlerËrDrzrr s rzSlider.set_val,ð × Ñ ˜zÒ I‰I× Ñ   t§y¡y§¡Ó'8Ñ!8Ô L‰L× " C  I‰I× Ñ   d§i¡i§o¡oÓ&7Ñ 7Ô L‰L× " C   ×јdŸl™l¨3Ó ;Š;Ø G‰G× Ñ  DÐ Ó )× ˆŒØ =Š=Ø O‰O× # I¨sÕ  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*).
có|«Srr4©r˜s €rrPz#Slider.on_changed.<locals>.<lambda>Pó ø€¹dÀ3»i€r!r™rs `rÚ
on_changedzSlider.on_changedAóø€ð×& yÓ2GÓHr!) r0r1r2r3r rr$s@rIsIø„ñ ð>AÈØ¨4¸4ب$¸Ø)°SØ(°tö Zòxò0ò04ö*Ir!c
ózeZdZdZddddddddddœ ˆfd
ZdZd „Zd
Zd Zd Z d
Z
dZ dZ dZ
dZdZˆ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´c ótt||| |||||| |
« ||f|_|€)||z
}tj||dzz||dzzg«}n|j |«}||_||_ddddœ}|
in|
}
i|¥|
¥j«Dcic] \}}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æriéÚgrid)Úwhichrréédr'Frírj)rsr ÚarrayrörrurIÚget_yaxis_transformÚget_xaxis_transformrÚzerosrûÚ_update_selection_polyÚ
set_transformÚget_pathÚ_interpolation_stepsÚ_request_autoscale_viewrÚ_handlesrrvrrÚ_active_handlerÑ)rrIrvr´rÚextentrrrr Úpoly_transformÚ
handleXY_1Ú
handleXY_2r…s €rr zRangeSlider.__init__bsø€ôd ј˜[¨)°YØ ¨°¸7ô Dð˜FÐŒØ ˆ?à˜f‘_ˆFÜ—h‘h ¨°$©Ñ 6Ø &¨°$©Ñ 6ð9‰Gð×+¨GÓ4ˆG؈ŒØˆŒ à!(°uÀbÑØ1‘r°|ˆ à(D¨8Ð(D°|Ð(D×(JÑ(JÓ(L÷
Ù $  1ˆfQCˆL˜!‰Oð
ˆ ñ
ð ˜ ˜"˜Ÿ,™,؈DŒJð
L‰L˜ŸÔ !ŸW™W×8¸vÐFˆNؘg a™jÐ)ˆ˜g a™jÐ)‰Jä˜!˜Ÿ,™,؈DŒJð
L‰L˜ŸÔ !ŸW™W×8¸vÐFˆ! !™* )ˆ! !™* )ˆœBŸH™H a¨ VÓÑŒ Ø×# WÑ ‰ ×Ñ Ô/Ø47ˆ ‰ ×ÑÓÔ ×ј$Ÿ)™)Ô × ˆBG‰Gð
Øð
àò
ðñ
ðò 
ð
ñ 
ð
ˆBG‰Gð
Øð
àò
ðñ
ðò 
ð
ñ 
ð

ˆŒ
ð ˜*Ò ŸØØØØŸ,™,Ø"*Ø$,ð
ˆDŒJðŸ7™7ØØØ ˜WÓŸ,™,Ø"'Ø$,ð
ˆDŸØØØØŸ,™,Ø"*Ø$+ð
ˆDŒJðŸ7™7ØØØ ˜WÓŸ,™,Ø"*Ø$*ð
ˆDŒLðÔØ ùó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érr)éN)Úxyrª)rÚvminÚvmaxÚvertss rr2z"RangeSlider._update_selection_polys™ð— ‘ — ˆØ × Ñ ˜zÒ )Ø"% t  +ˆE!‰Hu˜Q˜DyˆE!‰HؘDyˆE!‰HؘDyˆE!ŠHà"&¨  +ˆE!‰Hu˜Q˜SyˆE!‰HؘSyˆE!‰HؘSyˆ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Úmins rÚ_min_in_boundszRangeSlider._min_in_bounds/sZà $—+ Ø—>—xx —+‘+ˆCà ˜!‘Ò Ø—(‘(˜1+ˆ×" '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Úmaxs rÚ_max_in_boundszRangeSlider._max_in_bounds:sZà $—+ Ø—>—xx —++ˆ $—((˜1‘+Ò Ø—((˜1+ˆ×" 'r!cóR|j|d«|j|d«fS)z#Clip min, max values to the bounds.rr)rGrK)rÚvalss rzRangeSlider._value_in_boundsEs+à×# ¡GÓ,¨d×.AÑ.AÀ$ÀqÁ'Ó.JÐ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.rN) rGÚset_minrKÚset_maxr8rr)rÚposÚidxrËs rÚ_update_val_from_posz RangeSlider._update_val_from_posIäi‰iœŸ˜tŸx™x¨#™~ÓØ !Š8Ø×% cÓ*ˆCØ L‰L˜Õ à×% cÓ*ˆCØ L‰L˜Ô Ø × Ò Ø×Ñ :Ò×-¨s¨eÕ×#×-¨s¨eÕ 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.|jDcgc]}|j!«d|z
Œc}n-|jDcgc]}|j#«d|z
Œc}««}|j|}||jur||_ |j%|jdk(r|«y|«ycc}wcc}wr)rBrrIrˆrOr8rdr7Ú get_xdataÚ get_ydatarS)rrAr]r^Ú handle_indexÚhandles rzRangeSlider._updateXs˜à ;‰;  §¡°Ò!2Ø à :‰:Ð -°$·'±'×2BÑ2BÀ5Ó2IÈ!Ò2LØ#ˆ Ø L‰L× # D§G¡GÔ ×ÒØ à J‰JÐ Ð3¸D¿G¹G×<LÑ<LÈUÓ<SÐTUÒ<VØ$ˆ Ø L‰L× & t§w¡wÔ /Ø"&ˆ Ø ð×,¨UÓ3‰ ˆˆuÜ—y‘y¤§¡à×Ñ <Ò04¯}©}Ö =¨!ˆQ[‰[]˜
 Ó
=à/3¯}©}Ö =¨!ˆQ[‰[]˜
 Ó
"?ó@ˆ ð˜|Ñð ˜× ,Ø"(ˆ à ×!¨4×+;Ñ+;¸|Ò+K WÐQVÕWùò
>ùâ =s ÅG) Å5G. cód|j)d|j|dzd|j|dzdS|jj|jg|¢|j«\}}}}||jj «z
}||jj «z
}d|d|dS)rú(rz, rú)r)rrÚs1Ús2s rrzRangeSlider._formatzà ;‰;Ð t—{{ ¡VÑ,¨B¨t¯{©{¸¹VÑ/CÐ.DÀAÐ Ÿ9™9×Ð0˜sÐ0 D§K¡KЉLˆAˆr2
$—))× (ˆ $—))× (ˆrd˜"˜R˜D  "r!cóD|j||jdf«y)zx
Set the lower value of the slider to *min*.
Parameters
----------
min : float
rrEs 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_maxsð
d—hh˜qk (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))rrTrLN)ÚsortrÚ check_shaper°r2r7rrrrrrCrIrNrOrrDrzr)rrArBs rzRangeSlider.set_valœsDôg‰gc‹lˆÜ ×ј 3Õ—K‘K §¡ÐŒØ×*¨3Ó/‰
ˆˆdØ ×# D¨$Ô × Ñ ˜zÒ M‰M˜ ×   M‰M˜ ×   M‰M˜ ×   M‰M˜ ×    ×јdŸl™l¨D°$¨<Ó ;Š;Ø G‰G× Ñ  DÐ Ó )× 0× ˜$<ˆŒØ =Š=Ø O‰O× # °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*).
có|«Srr4r"s €rrPz(RangeSlider.on_changed.<locals>.<lambda>Èr#r!r™rs `rr$zRangeSlider.on_changed¹r%r!)r0r1r2r3r r2rGrKrSrrOrPr$s@rr'r'Ssgø„ñ ð*ØØØØØØ ØØövòp!ò*  Lò
 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ózeZdZdZddddddœˆfd ZdZdZdZd „Zd
Z dd Z
d Z d
Z dZ
dZdZdZˆ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ærj©rarlrk)rÚ linewidthr)rarÚnonerâÚblackç333333Ã?)ryrrb©raÚanimatedrpÚ
draw_eventrmrn)&rsr rÚcheck_isinstanceÚdictr€rr~Ú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__áø€ôP јÔä ×Ñœt T˜l¸ Ø*5À;õ Pð
Ø
Ø
˜Ôà ˆ?Ø F£ Ñ+ˆGàÒ= D§K¡K×$=Ñ$=ˆŒ
؈Ôä
[‰[˜˜Aœs 6{¨1™}Ó
-¨a°Ð
3ˆäÓ5ˆ ô
$' r¨6°;Ó#?÷ AðAñ 5˜
ˆBG‰GD˜!˜
¨b¯l©lØ(.À(ñ
àó
ôAˆŒ ô
—H‘H¸d¿k¹kÖJ°d˜d×KÈaÑOˆ ð˜A‘Øñ
ô×$ [´+×2LÑ2LÓ
ðØŸò 
ˆ ð ×ј{¨K¯O©O¸GÀVÓ,LÔ×ј{¨K¯O©O¸GÀWÓ,MÔ!r—zz 4 &¬3¨r«7Ñ"2°BÑF¸FˆŒ àØ˜A‘ñ
ô×$ [´+×2LÑ2LÓ
ðØŸØŸ
ò

ˆ ð ×ј{¨K¯O©O¸GÀWÓ,MÔ!r—zz 4 &¬3¨r«7Ñ"2°BÑF¸FˆŒ ð
×ј ×Ñз±Ô =Š=Ø × Ñ ˜|¨T¯[©[Ô ×0¸)¸Ôùô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“rr@s rrzCheckButtons._clearAsUà ;‰;  §¡×!6Ñ!6Ô!8Ø ØŸ;™;×5°d·g±g·l±lÓÔØ ×јDŸL™LÕ)r!cóv|j|«s-|jdk7s|jj|«dsyg|jj|«dd¢t |j «Dcgc]\}}|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 rrzCheckButtons._clickedHsØ ;‰;  §¡°Ò!2¸$¿'¹'×:JÑ:JÈ5Ó:QÐRSÒ:TØ ðSØ
\‰\×
" 
)¨!Ñ
,¨UÑ
S䯩Ó
Q‘GAt¸¿¹ÀuÓ9MÈaÓ9PŠaÓ
Sˆñ Ø—\‘\× ×,ˆFà O‰OؘŸ §¡Ð)¨F°4©LÑ8¸QÑ>×CÀBÓG×
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`.
rnrr€rrpr…r†Úupdate©rrorÚprops rÚset_label_propszCheckButtons.set_label_propsTóHô
×Ñœd¨%Õ" 5Ó)ˆÜ˜dŸk™k¨5Ó ‰JˆD K‰K˜Õ ñ r!cóîtjt|¬«d|vr;tj|j d«t
|j««|d<|jj|«y)
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Ú broadcast_torrr†r©rros rÚset_frame_propszCheckButtons.set_frame_propsesRô
×Ñœd¨%Õ %‰<ÜŸ_™_¨U¯Y©Y°s«^¼SÀÇÁÓ=MÓNˆE'‰NØ ×ј"r!có0tjt|¬«d|vr;tj|j d«t
|j««|d<|j«}|jj|«|j|«y)
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€rr‹r‚r†Ú
get_statusrŽr)rrors rÚset_check_propszCheckButtons.set_check_propsvslô
×Ñœd¨%Õ %‰<ÜŸ_™_¨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)Úrangerr†r%rr€Úboolr
Úto_rgbarŽrrÚ_active_check_colorsrrCrxrOÚrestore_regionrIrrr“r”rDrzrÚget_text)rÚindexr¶Ú invisibleÚ
facecolorss rr;zCheckButtons.set_activeŠsLð, œœc $§+¡+Ó Ð:¸5¸  ×Ñœt T˜l°%Õ—N‘N 6Ó*ˆ à—\‘\×
Ø ˆ×% Ñ&7¸ÓCˆEÙ@E˜D×5°eÒ<È9ˆ
Ø ×"  ;Š;Ø}Š}Ø×—K‘K×.¨t×/?Ñ/?Ô×# D§L¡LÔ × Ñ  §¡§¡Õ × Ñ Ô =Š=Ø O‰O× # I¨t¯{©{¸5Ñ/A×/JÑ/JÓ/LÕ  r!cój|jj«|_t|j«dk(r0t j
|jt|«d¬«|_|jj
t|j|«Dcgc] \}}|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©rzN)rrrmrr…)rrÚecr:s rrzCheckButtons._init_status¸s˜ð%)§L¡L×$>Ñ$>Ó$@ˆÔ ˆt× )¨QÒ .Ü(*¯ © °$×2KÑ2KÜ25°g³,ÀQô)Hˆ  ×" 4×#<Ñ#<¸
HÙ‰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)
rr‚Ú set_visiblerCrOr”rDrzr)rÚl1Úl2s rÚclearzCheckButtons.clearÈð
×" F 8¬c°$×2KÑ2KÓ.LÑ#LÔ 4˜Ô Ÿ+™+ò
&˜uÔ˜uÕ
 ;Š;Ø K‰K× Ñ Ô à =Š=à O‰O× # I¨tÕ  r!c ó¬|jj«Dcgc],}tj|tjd«« Œ.c}Scc}w)zW
Return a list of the status (True/False) of all of the check buttons.
rz)Úget_facecolorsr
r)rrs rzCheckButtons.get_statusÙsJð
"Ÿ\™\×ô×% e¬V¯^©^¸FÓ-CÓ <ùò<s1Acóœt|j|j««Dcgc]\}}|r|j«Œc}}Scc}}w)z2Return a list of labels currently checked by user.)r…r†)rÚ box_checkeds rÚget_checked_labelszCheckButtons.get_checked_labelsàsBôD—K‘K §¡Ó!2Ó ¡  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™rs `rzCheckButtons.on_clickedçsø€ð&×& yÓ2IÓJr!có:|jj|«y©z-Remove the observer with connection id *cid*.Nržr s rzCheckButtons.disconnectür!r)r0r1r2r3r rrr;rs@rrrrrÐsaø„ñð ^F¸DØ!¨tÀö^Fò@
Sòò"#ò"#ó(,Nò\Iò 5ò" òKö*(r!rrcóˆeZdZdZddddddœˆfd Zed«Zd „Zd
Zd Z d Z
d
Z dZ dZ
dZdZdZdZdZˆ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Ú label_padÚ
textalignmentc
óft||«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î?)rj)rjF)rarkrlÚ
parse_mathÚchangeÚsubmitrn©rr)ÚxlimÚylimÚnavigateráÚxticksÚyticksrrr)ÚvisiblerrarprqrrÚ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Úcapturekeystrokes) rrIrvÚinitialrr…s €rr zTextBox.__init__sø€ô* јÔä"× S°4Ñ )ˆÔð—W‘WØ
ˆJ˜˜U¨b¯l©lØ&¸óEˆŒ
ð
ŸŸØ × Ñ   g¸¿¹×9JÑ9JØ&¸ðˆŒô
 ×0¸(ÀHÐ9MÔŒà
ؘfØ ˜ ô
ˆÔà—i‘i  1 a°¸cÀaÜ*-¯.©.×*JÑ*JÓ*Lð óNˆŒ ð
×Ñз±Ô ×ÑÐ1°4·=±=Ô ×ÑÐ0°$·,±,Ô ×ÑÐ,¨d¯n©nÔ ×ј>¨4¯<©<ÔˆŒ
Ø$ˆŒà!&ˆÕr!có6|jj«Sr)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”Úget_window_extentrÚy0Úy1ÚheightÚx0Úx1Úwidthrð)rÚfigrÚ widthtextÚbb_textÚ bb_widthtexts rÚ
_rendercursorzTextBox._rendercursorXs]ðg‰g× Ñ  dÐ ÓØ × Ñ Ó Ð J‰JO‰OÔ à~‰~×(ˆØÐ+˜,ˆ à—.‘.ר ×Ñ  Ò 0¨SÔ—~‘~× à :‰:˜ŸÒ JŠJ˜,×Ñ 1 JŠJ˜,×Ñ 1ŽJÙØ ŸˆG Ÿ l×&8Ñ&8Ñ8ˆGŒJà ØŸ
 G§J¡JÐ/°'·*±*¸g¿j¹jÐ1IÐð ô ð
×Ñ Ô
Õr!cóº|j|«ry|jj|jk7ry|jj |j«yr)rBrOr‰rIr@s rr|zTextBox._release{s@Ø ;‰; Ø Ø <‰<× ¯©Ò Ø
×" 4§7¡7Õ+r!có>|j|«ry|jrþ|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ÚhomeÚendÚ backspaceÚdeleterÝ)ÚenterÚreturnrÞ) rBÚkeyrrrrrDrzr)rrArrs rzTextBox._keypressØ ;‰; Ø Ø × —)‘)ˆCØ—9‘9ˆDÜ3‹x˜1Š}ØÐ/˜d×0°3јT×1à×! ˜Ø×¨D« Ò×јØ×Ò×јØ$%Õ˜Ü$'¨£IÕ˜ Ò×Ò Ð!7 $×"3Ñ"3°aÑ"7Ð  ×!2Ñ!2Ð!3Ð5×јØ×¨D¯I©I«Ò Ð!3 $×"3Ñ"3Ð  ×!2Ñ!2°QÑ!6Ð!7Ð9 N‰N× # DÔ × Ñ Ô Ø}Š}Ø×°$·)±)ÔЗO‘O×+¨H°d·i±iÕð9 "r!cóBt|«}|j|k(ry|jj|«|j «|j
rM|j jd|j«|j jd|j«yy)NrÝ)ÚstrrrrrDrzr)rÚnewvals rzTextBox.set_val¦stÜS“ˆØ 9‰9˜Ò Ø Ø ×Ñ Ô ×ÑÔØ =Š=Ø O‰O× # H¨d¯i©iÔ O‰O× # H¨d¯i©iÕ  r!c ó4d|_t«}|j|_t |j
j
d¬«jjdd«}|8|j|«|j|jj|«ytj«5|jtj tj"Dcic]}|j%d«sŒ|gŒc}««ddd«ycc}w#1swYyxYw)NTrLÚ toolmanagerzkeymap.)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°Ø!%ˆÔô ˆØ$Ÿ{™{ˆÔÜØ G‰G× Ñ  DÐ Ó 8¸-ÈóOˆ à Ð 
× $  N‰N˜;×;¸TÕ ×
OØ×#¤C§N¡NÜ$'§L¡LÖL˜q°A·L±LÀÕ4K‘UÒ%NôO÷
Oð
Oùâ
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)NTFrL) rrIrNrOr”rDrzrr)rÚ notifysubmits rÚ stop_typingzTextBox.stop_typingÅsØ × × Ñ Ô "Ø#'ˆ ؉Là ˆLØ!&ˆÔØ ×Ñ Ô ×Ñ ÐÓ ˜DŸMšMð
O‰O× # H¨d¯i©iÕ *ˆ<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Ú_char_index_atrbrr@s rr{zTextBox._clickÔØ ;‰; Ø Øw‰w×Ñ Ó& qÒ × Ñ Ô Ø Ø}Š}Ø Ø <‰<× ¯©Ò L‰L× # D§G¡GÔ × × Ñ Ô Ø ŸN™N×9¸%¿'¹'ÓBˆÔØ ×ÑÕr!có$|j«yr)r"r@s rzTextBox._resizeãsØ ×ÑÕr!cóª|j|«ry|jj|«dr |jn |j}t j ||jj««s]|jj|«|jr5|jjd¬«jj«yyy)NrTrL)
rBrIrˆrr
rrrrCrNrOr”r•s rr}zTextBox._motionæØ ;‰; Ø Ø#Ÿw™w×Ó6°qÒ9ˆDOŠO¸t¿z¹zˆÜ× Ñ   D§G¡G×$9Ñ$9Ó$;Ô G‰G× !  {Š{Ø×Ð-×4×ð=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.
có|«Srr4s €rrPz(TextBox.on_text_change.<locals>.<lambda>õó ø€¹dÀ4»j€r!r™rs `rÚon_text_changezTextBox.on_text_changeïsø€ð ×& xÓ1HÓIr!cóB|jjdˆfd«S)
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.
có|«Srr4s €rrPz#TextBox.on_submit.<locals>.<lambda>þr)r!r™rs `rÚ on_submitzTextBox.on_submit÷sø€ð×& xÓ1HÓIr!có:|jj|«yr s rzTextBox.disconnectr!)Ú)r0r1r2r3r rErrr|rr"r{r}r*r-s@rssø„ñð,:¨¸Ø:'ðxñð!òF"AòHOò*

òòJòJö(r!có’eZdZdZdddddœˆfd ZdZdZdZd „Ze d
«Z
e
jd «Z
d Z d
Z
dZdZˆ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«Dcgc]\}}||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)rsr2zŠBoth the *activecolor* parameter and the *facecolor* key in the *radio_props* parameter has been specified. *activecolor* will be ignored.ÚblueFrrr)rwrjrxrr'r}rr{r|rzrprrmrn).rsr rr€rr rir rˆÚ
warn_externalÚ _activecolorÚ_initial_activeÚvalue_selectedÚindex_selectedr€rr~r„rrOrwrxrpr…rrur†r.r‡r‰rÚ_buttonsrÚ_active_colorsrmrrVrrryrz)rrIr†r:Ú activecolorrgrsr2r“rcrvrorr”r…s €rr zRadioButtons.__init__s ø€ôR јÔä ×Ñœt T˜l¸ Ø*5õ×,¨[Ü-8×-GÑ-GóIˆ à Ð ˜×
!ˆ'ˆÔØÔØ$ V™nˆÔØÔà
Ø
Ø
˜Ôä
[‰[˜˜Aœs 6›{¨Q™Ó
°"Ð
5ˆàÒ= D§K¡K×$=Ñ$=ˆŒ
؈ÔäÓ ô
$' r¨6°;Ó#?÷ AðAñ 5˜
ˆBG‰GD˜!˜
¨b¯l©lØ(.À(ñ
àó
ôAˆŒ ô
—H‘H¸d¿k¹kÖJ°d˜d×KÈaÑOˆ ð
˜Að
àð
ðØŸØŸ
ò 
ˆ ð ×ј{¨K¯O©O¸GÀWÓ,MÔ×ј{بw¸ Ó Fà"˜Ÿ
 C 5¬3¨r«7¡?°BÑF¸Œ
ð#Ÿm™m×;ˆÔÜ ˆt× #  (Ü"$§)¡)¨D×,?Ñ,?ÄÀVÃØ12ô#4ˆ à
×#ä#,¨T×-@Ñ-@Ó#A÷
CÙ šK‰[¨VÑ

Cô Dð
×Ñз±Ô =Š=Ø × Ñ ˜|¨T¯[©[Ô ×0¸)¸ÔùôCAùò
Kùó*
CsÄ+.L>ÆMËM
có|j|«s|jj«ry|jj|jj
«|_|jj|j«yr) rBrOr—r˜rIr“rr:r@s rrzRadioButtons._clear‡sUà ;‰;  §¡×!6Ñ!6Ô!8Ø ØŸ;™;×5°d·g±g·l±lÓÔØ ×јDŸM™MÕ*r!cóv|j|«s-|jdk7s|jj|«dsyg|jj|«dd¢t |j «Dcgc]\}}|j|«dsŒ|Œc}}¢}|r|jj«j|jj««}|j||j|jf||z
dzjd«j««yycc}}w)rBrrIrˆr:r†rrar;rbrcr s rrzRadioButtons._clickedŽsØ ;‰;  §¡°Ò!2¸$¿'¹'×:JÑ:JÈ5Ó:QÐRSÒ:TØ ðSØ
]‰]×
# 
*¨1Ñ
-¨eÑ
S䯩Ó
Q‘GAt¸¿¹ÀuÓ9MÈaÓ9PŠaÓ
Sˆñ Ø—]‘]×
×-ˆFà O‰OؘŸ §¡Ð)¨F°4©LÑ8¸QÑ>×CÀBÓG×
Sð ùóRcó®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¦s rzRadioButtons.set_label_propsšr!có²tjt|¬«d|vr;tj|j d«t
|j««|d<|jj|«|jj«|_ t
|j«dk(r:tj|jt
|j«d¬«|_ |jjt|j|j«Dcgc]&\}}|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­rrrzN)rr€rrrr†r:rr;rmrr…r8)rrorr<s rÚset_radio_propszRadioButtons.set_radio_props«sô
×Ñœd¨%Õ %‰<ÜŸ_™_¨U¯Y©Y°s«^¼SÀÇÁÓ=MÓNˆE'‰NØ
×ј"Ÿm™m×;ˆÔÜ ˆt× #  (Ü"$§)¡)¨D×,?Ñ,?Ü,/°· ± Ó,<À1ô#Fˆ à
×#ä&)¨$¯+©+°t×7JÑ7JÓ&K÷
MÙ"!ŸM™MO¨t×/BÑ/BÒB‰[ÈÑ

Mõ Nùó
MsÄ+E
có|jSr)r6rs rr<zRadioButtons.activecolorÃsà× Ñ Ð r!códtj|¬«||_|jd|i«y)N)r<)r
Ú_check_color_liker6rA)rr<s rr<zRadioButtons.activecolorÇs+ä× Ñ ¨[ÕÔØ ×јk¨;Ð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)rr†r%r8r9r:rr
r;rrCrxrOrIrrr“r”rDrzr)rÚbutton_facecolorss rr;zRadioButtons.set_activeÍsL𠜜c $§+¡+Ó Ð:¸5¸ "Ÿk™k¨%Ñ0×ÔØÔØ ŸM™M×Ü%Ÿ~™~¨fÓ™!ÐÜ#)§>¡>°$×2EÑ2EÀeÑ2LÓ#MИ Ø
×#Ð$5Ô ;Š;Ø}Š}Ø×—K‘K×.¨t×/?Ñ/?Ô×# D§M¡MÔ × Ñ  §¡§¡Õ × Ñ Ô =Š=Ø O‰O× # I¨t¯{©{¸5Ñ/A×/JÑ/JÓ/LÕ  r!có:|j|j«y)z4Reset the active button to the initially active one.N)r;r7rs rzRadioButtons.clearòsà ˜×-r!có:|jjd|«S)rmr™rs rzRadioButtons.on_clickedösð&×& y°$Ó7r!có:|jj|«yr s rzRadioButtons.disconnect r!)rN)r0r1r2r3r rrrArEr<Úsetterr;s@rr1r1sxø„ñð,iFب4¸TöiFòV
Sòò"Nð0ñð×Ññð
#NòJ8ö*(r!r1có"eZdZdZdZdZdZy)Ú 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
)
Parameters
----------
targetfig : `~matplotlib.figure.Figure`
The figure instance to adjust.
toolfig : `~matplotlib.figure.Figure`
The figure instance to embed the subplot tool into.
çš™™™™™É?gÍÌÌÌÌÌì?)z'Click on slider to adjust subplot param)ÚwspaceÚhspacerFr)rw)gš™™™™™é?rÛr|g333333³?ÚResetN) ÚfigureÚ targetfigÚsubplots_adjustÚsuptitleÚ_slidersr…Úsubplotsrr~rÚ subplotparsr$Ú_on_slider_changedrSÚaxesÚremoveÚ
sliderleftÚ sliderbottomÚ sliderrightÚ slidertopÚ sliderwspaceÚ sliderhspacer¯r×Úadd_axesrfÚ buttonresetrœÚ _on_reset)rrSÚtoolfigÚnamesr¬rIÚsliderÚbaxs rr zSubplotTool.__init__ðˆŒ ØŒØ×Ñ S°ÐÔ×ÑЈŒ
Úä˜E 7×#3Ñ#3´C¸³JÀ±NÓ#CÓ )‰HˆD O‰O˜ ˜B  Ü$+¨I×,AÑ,AÀ4Ó$HôJˆFà × Ñ ˜d× M‰M× Ñ  Õ   ×ÑÔ!à15·±ñŒ˜$Ô+¨TÔ-=¸t¼~Ø
Ô ˜DÔ¨×(9Ñ(9Ø×(¨$×*;Ñ*;ð %ˆ$ˆ ðׯ©Ð %ˆ$ˆ ð%)×$4Ñ$4ˆÔ!Ø%)§_¡_ˆ×ÑÔ"Ø&*§n¡nˆ×ÑÔ#Ø#'×#4Ñ#4ˆÔ à×ÑÒÜ! # wÓÔØ ×Ñ×# D§N¡NÕ3r!c ó|jjdi|jDcic]'}|jj «|j
Œ)c}¤Ž|j r%|jjj«yycc}wrh) rSrTrVrvrCrOr”)rrrgs rrYzSubplotTool._on_slider_changed@stØ&ˆ×!Ÿ]™]öð|‰|ׯ
©
Ñ ;Š;Ø 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_cmrVrCrOr”rY)rrArrgs rrdzSubplotTool._on_resetGÜ

˜
× Ñ ¤× 1Ñ 1°$¸uÔ EÔ Ÿ-™-ò
MØ××% f°UÀUÔMð
MðŸ-™-ò
Ø ñ
÷
ð ;Š;Ø L‰L× Ñ Ô Ø ×Ñ Õ
ð
ús BC à CN)r0r1r2r3r rYrdr4r!rrLrLsñò)4òV&r!rLcó8eZdZdZddddœˆfd
ZdZdZˆ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~rF)rsr rVÚonmoverÈrnrorOrwrgÚ
get_yboundÚlinehrÿÚ
get_xboundÚlinevÚ
backgroundÚ needclear)rrIrnrorgÚ linepropsr…s €rr zCursor.__init__tø€ä
јÔà ×ÑÐ0°$·+±+Ô ×ј<¨¯©ÔˆŒ ؈Œ ؈Œ ØÒ< 4§;¡;×#<Ñ#<ˆŒ à <Š<Ø$(ˆI R—ZZ §
¡
£°Ñ 2ÑO¸EÐOÀYÑŒ
ØR—ZZ §
¡
£°Ñ 2ÑO¸EÐOÀYÑŒ
àˆŒØˆ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 rz Cursor.clearˆsJà ;‰;  §¡×!6Ñ!6Ô!8Ø Ø <Š<Ø"Ÿk™k×8¸¿¹¿¹ÓFˆD 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ˆrursrwr”rdrrorrnrgrvrrr“r©rrAr]r^s rrqz
Cursor.onmoves à ;‰; Ø Ø{‰{×Ô Øw‰w×Ñ Ó&  J‰J× "  J‰J× "  ~Š~Ø × Ñ Ô"Ø!&Ø ØˆŒØ×,¨UÓ3‰ ˆˆuØ
×јe U˜^Ô
×јtŸ|™|Ò· ± Ô
×јe U˜^Ô
×јtŸ|™|Ò· ± Ô  $§+¢+°·²Ø à <Š<ØÐ ×*¨4¯?©?Ô G‰G× Ñ  §
¡
Ô G‰G× Ñ  §
¡
Ô K‰K× Ñ ˜TŸW™WŸ\™\Õ K‰K× #r!)r0r1r2r3r rqs@rrmrmXs!ø„ñð6'+°4Àöò(Gö$r!rmcó8eZdZdZddddœdZdZdZdZd „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||_||_||_||_|Dcic]"}|j d¬«j
gddœŒ$c}|_|dj«\}} |dj«\}
} d|| zz} d|
| zz}
d|_ |xrtd|j D««|_ |jrd|d<|Dcgc]}|j| fdd i|¤ŽŒc}|_
|Dcgc]}|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¨VJùsr~F)Ú_canvasrZrnrorNrOÚ
_canvas_infosÚget_xlimÚget_ylimråÚallrgrÿÚhlinesrš)rrOrZrgrnrorxrIÚxminÚxmaxÚyminÚymaxÚxmidÚymids rr zMultiCursor.__init__ÔscðˆŒ àˆŒ ؈Œ ؈Œ ð<@öAà57ð
M‰M˜tˆMÓ ¨4Ñ
AˆÔð˜"X×(‰
ˆˆ˜"X×(‰
ˆˆd˜T"ˆØd˜TàˆŒ à ò
KÜÑJ°t×7IÑ7IÔ
Œ ð <Š<Ø$(ˆI "&öð"r—zz ÐC¸Ó'ˆŒ ð"&öð"r—zz ÐC¸Ó'ˆŒ ð
ùò-Aùò"'ùò's¡'D*Ã
D/Ã5D4có¾|jj«D]@\}}|jd|j«|jd|j«g|d<ŒBy)zConnect events.rrrr€N)r…rRrq)rrOÚinfos rzMultiCursor.connectösXà × ‰LˆF×"Ð#8¸$¿+¹+Ó×" ·±ÓˆDŠLñ r!có¤|jj«D]3\}}|dD]}|j|«Œ|dj«Œ5y)zDisconnect events.r€N)r…rX)rrOrrUs rzMultiCursor.disconnectþsUà ×.× !‰LˆF˜F
+Ø×% 
‰L× Ñ Õ ñ !r!có|j|«ry|jrd|jj«D]F\}}||jj
urŒ|j
|jj«|d<ŒHyy)zClear the cursor.Nrv)rBrgr…rRrOr˜r“)rrArOrs rzMultiCursor.clearswà ;‰; Ø Ø <Š<Ø $× 2Ñ 2× 8Ñ 8Ó :ò
O ˜ð
 §¡×!5Ñ!5ÑØ%+×%:Ñ%:¸6¿=¹=×;MÑ;MÓ%N
Oð r!có~|jDcgc]}|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`rarbrcrror‰rrnrgr…r…rrr) rrArIÚaxsr]r^ÚlinerOrs rrqzMultiCursor.onmoves;Ø ŸI™IÖ?¯©°UÓ);¸AÓ)>ŠrÐ?ˆÐ ;‰; ¡S°· ± ×0GÑ0G×0QÑ0QÐRVÔ0WØ Ü
×
" 
'ˆØ6;·l±lÀbÑ6H˜Ÿ e§k¡kÑŸ\™\×4×ÇÁÈÏÉÐ?QÓ ˆˆuà—K ;ˆ N‰N˜E 5˜ × Ñ ˜TŸ\™\Ò9¨d¯k©kÕ —K <ˆ N‰N˜E 5˜ × Ñ ˜TŸ\™\Ò:¨d¯l©lÕ   $§+¢+°·²Ø à <Š<Ø $× 2Ñ 2× 8Ñ 8Ó :ò
>‘ ˜Ø˜ Ó×)¨$¨|Ñ*<Õ
{Š{Ü # D§I¡I¨t¯{©{Ó ;ò)‘HØ—N‘N |Š|Ü # D§I¡I¨t¯{©{Ó ;ò)‘HØ—N‘N 4Õ×
Ø
ñ
ð×
#Ø× Ñ Õ
#ùò9@s
J:©J:N) r0r1r2r3r rqr4r!rr~r~¯s,ñ"ðH15¸eÈDô òDò Oó#r!r~cóæeZdZ d ˆfd„ ZˆfdZdZdZdZdZdZ dZ
d „Z d
Z d Z
d Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZed«ZdZdZdZ dZ!dZ"ˆ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Ú validButtonsÚ_selection_completedÚ _eventpressÚ
_eventreleaseÚ _prev_eventrëÚ_state)rrIrgrÚstate_modifier_keysÚuse_data_coordinatesr…s €rr z_SelectorWidget.__init__6ø€ä
јÔàˆŒ
Ø Ð Ù.ˆD$ˆDŒMØÒ< 4§;¡;×#<Ñ#<ˆŒ Ø ×%ä$(¨c¸Ø07À Ø03ô%5ˆÔ
×!×(Ð)<Ò)BÀÔCØ%9ˆÔˆŒä fœhÔ 'Ø!' ˆ à &ˆ ð%*ˆÔ ˆÔàÔØˆÔÜ“eˆ r!cóLt||«|r|jd«yyr)rsr;Úupdate_background)rr:r…s €rr;z_SelectorWidget.set_activeYs&ø€Ü
ј Ø × "   r!cóxtˆfdjj«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 €rz8_SelectorWidget._get_animated_artists.<locals>.<genexpr>fsLøèø€òD˜3ØDØØŸÔ(¨Q°d·l±lÑ-BôðDDù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©s rrPz3_SelectorWidget.update_background.<locals>.<lambda>zs  q§|¡|£~€r!©rc3ó<K|]}|j«Œy­wr)Ú get_visible)rÚartists rz4_SelectorWidget.update_background.<locals>.<genexpr>{sèø€ÒF°F˜6×FùsF))rgrOr—Úsortedr¸rrÚ_cm_setr”r˜rIr“rvr)rrAr¸Ú needs_redrawrs rz!_SelectorWidget.update_backgroundjð|Š|Ø Ø ;‰;× Ñ Ô ô˜Ÿ¨×(BÑ(BÓ(DÑäÑF¸gÔ Ü
‹[ð G˜EÙØGׯ©¸Ó(EÕGà × Ñ Ô"Ÿk™k×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.rrrprqrÚkey_release_eventÚ scroll_eventN)rVrqÚpressr*Ú on_key_pressÚon_key_releaseÚ on_scrollrs rz&_SelectorWidget.connect_default_events†s™à ×ÑÐ0°$·+±+Ô ×Ñз±Ô ×ÑÐ1°4·<±<Ô ×ј×)?Ñ)?Ô ×ÑÐ,¨d×.?Ñ.?Ô ×ÑÐ×0CÑ0CÔ ×ј>¨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:rIrOr{r$rrˆr@s rrBz_SelectorWidget.ignoreà{Š{ $§'¡'×"5Ñ"5Ô"7Øà{‰{×ÔÜu˜ˆEŒLð
× Ñ Ð —L‘L¨×(9Ñ(9Ñà × Ñ Ð —ww×Ó.¨qÑ <‰<˜4×+× à—G‘G×$ UÓ+¨AÑ  × 0Ñ 0× 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«Srs rrPz(_SelectorWidget.update.<locals>.<lambda>¶s ¨1¯<©<«>€r!)rIrNrgrvrOr¸rrr“r)rr¸s rz_SelectorWidget.update¨à××Ð-× Ø <Š<ØÐ ×*¨4¯?©?Õ×& ˜TŸ\™\¨D×,FÑ,FÓ,HÑHÙ!9ô;ˆ
,Ø×# FÕ
K‰K× Ñ ˜TŸW™WŸ\™\Õ K‰K× #r!có|jy|j|«\}}tj|g|jj «¢­Ž}tj|g|jj
«¢­Ž}||fS)z/Get the xdata and ydata for event, with limits.)NN)r]rdÚcliprIrtrrr|s rÚ _get_dataz_SelectorWidget._get_data½smà ;‰;Ð ØØ×,¨UÓ3‰ ˆˆuܘЧ¡× 2Ñ 2Ó 4ÒܘЧ¡× 2Ñ 2Ó 4ÒØ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]ÚcopyrÖr^r@s rÚ _clean_eventz_SelectorWidget._clean_eventÆsKð ;‰;Ð Ø×$‰Eä—II˜$ˆ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¡TF)
rBrÚreplacer¨ÚaddÚ_press)rrArs rz_SelectorWidget.press×s€à{‰{˜5Ô×% eÓ,ˆEØ$ˆDÔ Ø$ˆDÔ Ø—)‘)’/˜rˆCØ—+‘+˜f iÓ0ˆCàÑ  Ô K‰K˜Ô ØØr!cóy)úButton press event handler.Nr4r@s rz_SelectorWidget._pressærr!cóä|j|«s_|jrS|j|«}||_|j |«d|_d|_|j
j
d«yy)z+Button release event handler and validator.Nr¢TF)rBr­r|Údiscardr@s rr*z_SelectorWidget.releaseésbà{‰{˜! d×&6Ò&6Ø×% ,ˆEØ!&ˆ Ø M‰M˜ Ø#ˆDÔ Ø!%ˆDÔ Ø K‰K× Ñ  Ô Ør!cóy)úButton release event handler.Nr4r@s rr|z_SelectorWidget._releaseõrr!có„|j|«s/|jr#|j|«}|j|«yy)ú(Cursor move event handler and validator.TF)rBÚ_onmover@s rrqz_SelectorWidget.onmoveøs8à{‰{˜! d×&6Ò&6Ø×% ,ˆ L‰L˜Ô ØØr!cóy)úCursor move event handler.Nr4r@s rz_SelectorWidget._onmove rr!cóJ|j|«s|j|«yy)z)Mouse scroll event handler and validator.N)rBÚ
_on_scrollr@s rz_SelectorWidget.on_scroll sà{‰{˜ O‰O˜ "r!cóy)zMouse scroll event handler.Nr4r@s rz_SelectorWidget._on_scroll rr!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Úsplitr¯Ú
_on_key_press©rrArÚmodifiers rz_SelectorWidget.on_key_press à ;Š;Ø—)‘)’/˜rˆCØ—+‘+˜f iÓ0ˆCØÑ
ØØ%)×%>Ñ%>×%DÑ%DÓ%Fò
!˜Ø˜sŸy™y¨›~Ò Ò  D§K¡KÑ ŸK™K×Õ ŸK™KŸO™O¨EÕŸ Ÿ¨Õ

× Ñ ˜ %ð# r!cóy)z@Key press event handler - for widget-specific key press actions.Nr4r@s rz_SelectorWidget._on_key_press rr!có|jry|jxsd}|jj«D]:\}}||j d«vsŒ|dk7sŒ |j
j
|«Œ<|j|«yy)z(Key release event handler and validator.r/N)r:rÚ_on_key_releaserñs rz_SelectorWidget.on_key_release# syà ;Š;Ø—))/˜rˆCØ%)×%>Ñ%>×%DÑ%DÓ%Fò
!˜ð˜sŸy™y¨›~Ò-°%¸8Ó2CØ—KK×Õ
× Ñ  Õ  r!cóy)úKey release event handler.Nr4r@s rz_SelectorWidget._on_key_release. rr!cóV||_|jD]}|j|«Œy)z+Set the visibility of the selector artists.N)r¸)rs rz_SelectorWidget.set_visible1 s*àˆŒ
Ø—l‘lò (ˆ × Ñ ˜  (r!có|jS)z+Get the visibility of the selector artists.)rs rz_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 rz_SelectorWidget.clear; sà ×
r!có4d|_|jd«y©NF)rs rz%_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'ô" $Ð(:¸?ˆØ×(¨?Ñ:r!c ó¦|j}tj||«}|jdi|¤Ž|jr|j «yy)
Set the properties of the selector artist.
See the *props* argument in the selector docstring to know which properties are
supported.
Nr4)rr rirg)rros rÚ set_propsz_SelectorWidget.set_propsJ sGð×'ˆÜ×& u¨fÓ5ˆØˆ
ÑØ <Š<Ø K‰K r!c ó0t|d«s td«|jd}tj||«}|jD]}|j
di|¤ŽŒ|j r|j«|jj|«y)
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 rirgÚ
_handle_props)rÚ handle_propsrÆrYs rÚset_handle_propsz _SelectorWidget.set_handle_propsW s‡ô %Ð&KÓ ×& )ˆÜ×-¨l¸FÓCˆ Ø× 'ˆ ˆFJ‰JÑ &˜Ó  <Š<Ø K‰KŒMØ ×Ñ×! /r!cóª|jj«Dcgc]\}}|dk7r|dk7r|Œ}}}tj||¬«ycc}}w)NrÈúnot-applicablerµ)rr­)rrÚ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
©rs rÚ add_statez_SelectorWidget.add_stateo s"ð"
×јUÔ ˜Õr!có\|j|«|jj|«y)
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[rs rÚ remove_statez_SelectorWidget.remove_stateƒ s$ð"
×јUÔ ×ј!r!)NFNNF)$r0r1r2r r;rBr*r|rqrEr¸rrr
rrs@rr™r™4ø„à@DØ@Eõ!ôF
Dò,ò89ò0$ò*òò"
ò
òò
&ò*Oò  òò
 ðñð
ò0ò"ö("r!r™c
óeZdZdZdddddddddddddœ ˆfd
Zdddœd „Zd
Zed «Zd Z ˆfd
Z
dZ ed«Z e jd«Z dZdZdZdZdZdZed«Zed«Zejd«ZdZˆ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
)rj)rgrÚredri)Úalphar~Ú_propsÚ_initrrFrJ)rrsr rgÚ directionÚ_extents_on_pressrrrrÚ _interactiveÚ
_edge_handlesrrÚnew_axesrŠr rirrÚ _edge_orderÚ_setup_edge_handlesr8)rrIr"rrgrorrrrrrrrr…s €rr zSpanSelector.__init__ë s&ø€ð Ð &Ü"&¨XØ.>Ø.>Ø.>ô#@Ð ô ј˜X¨w¸vØ-@ð ô Bð ˆ=Ü 5°Ô4ˆEà ŸL™LˆˆjÑà"ˆŒØ!%ˆÔØÔàÔØˆŒ àŒØ'ˆÔØ!ˆÔØ"4ˆÔØ$8ˆÔ
b ¨dˆ
Ô
U—YY˜{¨CÓ×$ \´Ôð × Ò Ø % u˜~ˆDÔ Ø × $ T×%7Ñ%7Ô "ˆÕ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¨)rr©rr)ra)rOrNrZrIr"r0r/rrÚ update_fromrù) rrIr r!Ú reconnectÚtransÚwrWÚ rect_artists rr&zSpanSelector.new_axes
àˆ Ù D—KK r§}¡}¸$ }Ó'?×'FÑ'FÑ{‰{Ð׈ˆŒÙ Ø × %*ˆÔ >‰>˜ ×,ˆE؉DˆA‰qà×,ˆE؉DˆAˆqÜ ¨¨1¸ÀuÔ Ø Ð Ø × Ñ ˜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á àŸ¨<Ò+×+×
ô2ˆFà ×Ñ ÐÓ7¸Õ?r!cóvt|«t|dd«r|jd|j«yy)Nr$Frr)rsrrVÚ_hover)rr…s €rz#SpanSelector.connect_default_eventsR
s4ø€ä
Ñ ¨Ô × Ñ Ð4°d·k±kÕ  0r!cóØ|jd«|jr,|jj«r|j |«nd|_|j
|js|j
«|j|«\}}|jdk(r|n|}|j
€.|js"d|_
|j||f«d|_
y|jd«y)TNr¨F)
r<r$rÚ_set_active_handler8rdr"rÚ _set_extentsrÅ)rrAr]r^rs rzSpanSelector._pressX
à ×Ñ˜ÔØ × Ò  ×!7Ñ!7×!CÑ!CÔ!EØ × #  *à"&ˆ à × Ñ Ð &¨d×.?Ò.?à K‰KŒMà×,¨UÓ3‰ ˆˆuØ—^‘^ |Ò3‰E¸ˆà × Ñ Ð &¨t×/HÒ/Hð"ˆDŒMØ × Ñ ˜q !˜fÔ !ˆDŒMðð
× Ñ ˜ 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"rDN) rr­rDrr[r$r%r&rIr(r)rr"s rr"zSpanSelector.directionz
sô
×јL¨*ÐÕ Ô &¨9¸¿¹Ò+Gà × "× × Ò Ø×"×'ˆDŒOØ M‰M˜$Ÿ'™'Ô × Ò Ø××);Ñ);Õ(ˆDOr!cóÒ|jd«|js|jjd«|j|j
r
|j ry|j\}}||z
}||jkr7|jd«|j
r|j||«d|_n|j||«d|_|j«d|_y)FNT) r<r$rr8rÚextentsr)rrArArBÚspans rr|zSpanSelector._releaseŠ
à ×јÔà× Ò Ø × "× .¨uÔ × Ñ Ð '¨D×,EÒ,EØ× à—\‘\‰
ˆˆdØd‰{ˆà 4—< à × Ñ ˜UÔ ×
˜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%Úclosestrbrcr<r)rrArÚe_dists rr>zSpanSelector._hover©
seà ;‰; Ø à × Ñ Ð *°$×2KÒ2Kð
à×&×.¨u¯w©w¸¿¹Ó@‰ ˆˆ6Ø ×ј 4§?¡?Ñ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^r8r#rrAr) rrAr]r^rÚvpressrArBÚdvs rzSpanSelector._onmove¸
s4ð×,¨UÓ3‰ ˆˆ >‰>˜ ˆ×+‰FàˆAØ×+ˆFð
× Ñ  #Ò %¨$×*@Ñ*@Ð*LØ×/‰JˆDV‘ˆBØ B‰JˆDØ B‰J‰Dð×
Ò
 T×%8Ñ%8¸CÒ%?Ø×/‰JˆD×" àð
×(¨T×-FÒ-FØØ $ˆdŠ{Ø! 4dà ×ј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$ˆ >‰>˜ × "× Ô × "× ,¨T°D©[Õ × "× Ô × "× -¨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%rLrbrcr8rrÚ _containsrIr#r')rrAÚe_idxrMs rr@zSpanSelector._set_active_handleî
ð×2°5·7±7¸E¿G¹GÓD‰
ˆˆvð T—[ Ø"%ˆ Ø
d—o
%à"&ˆ Ø×&¨4¯>©>¸%Ô+@à&)Ô#Ø)-¯©Õ&à&*Ôð#'×"2Ñ"2°5Ñ"9ˆ ð"&§¡ˆÕr!cóB|jj|d¬«dS©z)Return True if event is within the patch.r)Úradius©rrˆr@s rrYzSpanSelector._contains ó#à×.¨u¸QÐÑ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)ÚsignrÉ)rrÚepsrs €€rz%SpanSelector._snap.<locals>.<genexpr> sFøèø€òàð
œŸ˜{¨Q™´·±¸³¸cÑ1AÑ ùsƒA A)rFÚdiffr»)Úvaluesrrcs `@rÚ_snapzSpanSelector._snap sDù€ôf‰f”R—V‘VœBŸG™G KÓ2°UÑÜôàôóð r!có |jdk(r;|jj«}||jj«z}||fS|jj «}||jj «z}||fS)
(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"rrÚ get_widthrÚ
get_heightrUs rrIzSpanSelector.extents sð >‰>˜ ×)×1ˆDؘ$×0×<ˆTˆð×1ˆDؘ$×=ˆTˆr!có4|j|«d|_y©NT)rA©rrIs rrIzSpanSelector.extents% sà ×ј"Ø$(ˆÕ!r!có<|j%t|j||j««}|j|Ž|jr%|j
j
|j«|j|j«|j«yr) rrfrVr$r%Úset_datarIrls rrAzSpanSelector._set_extents* suà × Ñ Ð ˜DŸJ™J ×0@Ñ0@ÓBˆˆ×ј × Ò à × Ñ × ¯ © Ô  ×јŸÔ
r!)r0r1r2r3r r&r(rErÿr<r"rJr|r>rVr@rYÚ staticmethodrfrIrAs@rrr˜ ø„ñPðd<=ÀeبT¸¨4¸BØ%)¸eØ&+¸ö +#ðZ&*°ô-ò: Cðñóðò @ôCò ð:ñóðð×Ññ
ð
ò>
*òX.ò4Cðñóððñ
óð
ð
‡^ð r!rcóleZdZdZdddœdZed«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 }|Dcgc] }||fi|¤ŽŒ
c}|_ycc}w)Nr¨rGF)r~)rIrr­rDr"rÿÚ_artists)rrIr3r"r1rgÚline_funÚps rr zToolLineHandles.__init__J sàˆŒä ×јL¨*ÐÕŒð
Ø3‰z¸ð
àØò
ˆ
ð "&§¡°<Ò!?2—::ÀRÇZÁZˆà<EÖF°q™ 2 Fˆ
ùÒFsÁ A9có,t|j«Sr)rrrs rr¸zToolLineHandles.artists[ säT—]#r!cóŠ|jdk(rdnd}|jDcgc]}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Ð%”˜˜Ó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)
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
rrN)r"r…r¸r)rr3rwr—rts rrnzToolLineHandles.set_dataj sIð!%§¡°,Ò >ÀKˆÜ˜4Ÿ<™<¨Ó *‰GˆD !ŒGD˜ ! 1 a   *r!cóH|jD]}|j|«Œy)z/Set the visibility state of the handles artist.N)r¸©rr s rzToolLineHandles.set_visiblex s#à—l &ˆFØ × Ñ ˜  &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 'ˆ × Ñ  Õ  'r!cóF|jD]}|j«Œy)z*Remove the handles artist from the figure.N)rrr[)rs rr[zToolLineHandles.remove sà—m ˆ M‰M r!c óú|jdk(rdtj|jDcgc],}|jj
j
|df«dŒ.c}«}t||z
«}nctj|jDcgc],}|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
rr) r"r.r3rIr_ra)rrbrcrtÚp_ptsÚdistr½s rrLzToolLineHandles.closest‡ ð >‰>˜ —HHØ@DÇÁöØ;<×!×+¨Q°¨FÓ3°AÓóˆu˜qy“>‰Dä—HHØ@DÇÁöØ;<×!×+¨Q°¨FÓ3°AÓóˆu˜q‘y“>ˆDÜ ˜$“ˆØd˜5‘kÐ!ùòùò
s ­1C3Â1C8)r0r1r2r3r rEr¸r3r"rnr}r[rLr4r!rr2r26 snñð&@DØôGð"ñðñEóðEð
ñóðò 

ó
"r!r2cójeZdZdZddddœdZed«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 rgcóà||_|dddddddœtj|tj«¥}t||fd|i|¤Ž|_|jj
|j
«y) Nér.rzri
_nolegend_)Ú
markersizeÚmarkerfacecolorÚ linestylerrvr~)rIr rirÚ
_alias_mapÚ_markersÚadd_line)rrIrbrcr rgros rr zToolHandles.__init__¸ sp؈ŒØÀsØ$¨s¸uØLô×)¨,¼×8IÑ8IÓLˆô˜q !Ñ?¨gÐÑŒ
Ø ×јŸÕ'r!có6|jj«Sr)rUrs rrbz
ToolHandles.xÁ óà}‰}×(r!có6|jj«Sr)rVrs rrcz
ToolHandles.yÅ rr!có|jfSr)rs rr¸zToolHandles.artistsÉ sà
Ð Ð r!cóp||}tj||g«}|jj|«y)z!Set x and y positions of handles.N)r.rn)rÚptsrcrbs rrnzToolHandles.set_dataÍ s0à ˆˆAÜ—(‘(˜A˜q˜"ˆ
×ј#r!có:|jj|«yr)r s rzToolHandles.set_visibleÔ sØ
×! &r!có:|jj|«yr)r}r s rr}zToolHandles.set_animated× sØ
×" 'r!có tj|j|jg«}|jj
j
|«}|||gz
}tj|jŽ}tj|«}|||fS)z1Return index and pixel distance to closest index.)
Ú column_stackrbrcrIr_raÚhypotÚTrÉ)rrbrcr“rdrÚ min_indexs rrLzToolHandles.closestÚ sräo‰o˜tŸv™v t§v¡vÐàg‰g×Ñ×)¨#ÓØV‰|ˆÜx‰x˜ŸÐ ˆÜ—I‘I˜d“Oˆ ؘ$˜y™/Ð)r!r)
r0r1r2r3r rErbrcr¸rnr}rLr4r!r¤ señð&,/¸TÈ4ôñðñðñð*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