+
    i                       ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt	 ^ RI
Ht ^ RIHt ^ RIHtHt ^ RIHtHtHtHtHt ^ RIt^ RIHt ^ RIt]P:                  R 4       tR t]P@                  PC                  R	]"! 4       ]"! R
^R7      ]"! ^
^
RR7      ]"! ]"! R
R7      R7      .4      R 4       t#]P@                  PC                  RRR.4      ]P@                  PC                  R^ ^
.^R.^^..4      ]P@                  PC                  R^ ^
.^R.^^..4      R 4       4       4       t$]P@                  PC                  RR
Rx.RRy..4      R 4       t%R t&R t'R t(]P@                  PC                  RR
R.4      R 4       t)]P@                  PC                  RR
R.4      R 4       t*R  t+]P@                  PC                  R!]PX                  ]PZ                  .4      R" 4       t.R# t/]P@                  PC                  R$RR
.4      R% 4       t0R& t1R' t2]P@                  PC                  R(R
R.4      R) 4       t3]P@                  PC                  R*R
R.4      R+ 4       t4]P@                  PC                  R,R-R]"! ^
R
R.7      3R/R
]"! ^R07      3R-R]"! ]"! R
R7      R7      3R-R]"! R
R17      3.4      R2 4       t5]P@                  PC                  R(R
R.4      R3 4       t6]P@                  PC                  R*R
R.4      R4 4       t7]P@                  PC                  R5R
R.4      R6 4       t8R7 t9R8 t:]P@                  PC                  R9R:R;.4      R< 4       t;]P@                  PC                  R9R:R;.4      R= 4       t<R> t=R? t>]P@                  PC                  R@Rz4      RA 4       t?]P@                  P                  RBR
RC7      RD 4       tARE tBRF tCRG tD]P@                  PC                  R	]"! 4       ]"! R]"! RHRI7      RJ7      ]"! R
^R7      .4      RK 4       tERL tFRM tGRN tH]P@                  PC                  RO. R{O4      RP 4       tIRQ tJ]! RR.RSR
RT7      RU 4       tK]! RV.RW7      RX 4       tL]! RV.RW7      RY 4       tMRZ tN]! RV.RW7      R[ 4       tO]! RV.RW7      R\ 4       tP]! RV.RW7      R] 4       tQR^ tRR_ tSR` tTRa tURb tVRc tW]P@                  PC                  RdR-R/.4      Re 4       tX]P@                  PC                  RdR-R/.4      Rf 4       tYRg tZRh t[Ri t\]P@                  PC                  RjRR
.4      Rk 4       t]]P@                  PC                  RjRR
.4      Rl 4       t^]! RV.RW7      Rm 4       t_]P@                  PC                  Rn. R|O4      ]P@                  PC                  RjRR
.4      Ro 4       4       t`]P@                  PC                  RjRR
.4      Rp 4       ta]P@                  PC                  RjRR
.4      Rq 4       tb]P@                  PC                  RjRR
.4      ]! RV.RW7      Rr 4       4       tcRs tdRt te]P@                  PC                  RuRR
.4      ]P@                  PC                  RvRR
.4      Rw 4       4       tfR# )}    N)mock)
MouseEvent)check_figures_equalimage_comparison)click_and_dragdo_eventget_ax
mock_eventnoop)assert_allclosec                      \        4       # N)r	        }/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_widgets.pyaxr      s	    8Or   c                     ^ RI Hp Hp ^ RIHp V! 4       R9  d   \
        P                  ! R4       \        P                  ! ^^R^^.R7      w  r4V! VR,          RR.4      pV! VR,          RR.RR	R
.R^^./RR	R
.RRR./R7      pV ! VR,          RR.RR.R7      pV ! VR,          RR.RR.RR	R
.R^^./RR	R
.RRR./RRR./R7      pVR,          P                  R4       VR,          P                  R4       VP                  P                  4        \        P                  ! 4       ;_uu_ 4       p	VP                  V	RR7       RRR4       R#   + '       g   i     R# ; i) r   )CheckButtonsRadioButtons)"_get_running_interactive_frameworkNz-Callback exceptions are not raised otherwise.)nrowsncolsfigsizewidth_ratiosApplesOrangescolorredorangefontsize	edgecolor	facecolor	mistyrose	peachpufflabel_propsradio_propsT)activesdarkred
darkorange)r(   r&   frame_propscheck_propsDefaultStylizedpdf)format)headlessN)      r   r   r      )r6   r   )r6   r6   )matplotlib.widgetsr   r   matplotlib.cbookr   pytestxfailpltsubplots	set_titlecanvasdrawioBytesIOsavefig)
r   r   r   figr   
default_rb	styled_rb
default_cb	styled_cbresult_afters
             r   test_save_blitted_widget_as_pdfrI      sx   =C)+3EEDEllq&1vGC bh9(=>J
48Y'uh/"b+ 5("3 ;"<>	I bh9(='+Tl4J
48Y'tuh/"b+ 5("3 ;"<>y,78I tHy!tHz"JJOO	L/ 
s   0EE	kwargsT)useblitbuttonpixels)minspanxminspany
spancoords)fillpropsc                 :   \         P                  ! \        R R7      p\        P                  ! V 3RV/VB p\        VR^d^d^R7       \        VR^^^R7       \        VR^^^R7       VP                  RR 4      R	9  d)   \        VP                  . R
O. RO.VP                  R7       VP                  4        VP                  w  w  rEpVP                  ^d8X  g   Q hVP                  ^d8X  g   Q hVP                  ^8X  g   Q hVP                  ^8X  g   Q hV/ 8X  g   Q hR # )Nspecreturn_valueonselectpressxdataydatarL   onmovereleasedrawtype)err_msg)linenone)      Y@d      re   rd   )rd   re   re   rd   rd   )r   Mockr   widgetsRectangleSelectorr   getr   geometryassert_called_once	call_argsr[   r\   )r   rJ   rX   toolepressereleases   &&    r   test_rectangle_selectorrp   @   s	    yyd6H$$RE(EfEDT7#S;T83c!< T9Cs1=zz*d#+;;324 $	/
 !!)!3!3V<<3<<3>>S   >>S   R<<r   rP   datazminspanx, x1      %@zminspany, y1c           	      $   \         P                  ! \        R R7      p^
^
rVR8X  d@   V P                  P	                  W534      V P                  P	                  Wx34      ,
          w  r$\
        P                  ! WRVW$R7      p	\        WV3W3R7       V	P                  '       d   Q hVP                  4        \        V	RRR7       V	P                  '       g   Q hVP                  4        VP                  4        \        WV3W53R7       V	P                  '       d   Q hVP                  4        VP                  w  w  rpV
P                  V8X  g   Q hV
P                  V8X  g   Q hVP                  V8X  g   Q hVP                  V8X  g   Q hV/ 8X  g   Q hR # )NrU   rM   T)rX   interactiverP   rN   rO   startend   ry      r{   )r   rf   r   	transData	transformrg   rh   r   _selection_completedassert_not_calledrk   
reset_mockrl   r[   r\   )r   rP   rN   x1rO   y1rX   x0y0rm   rn   ro   rJ   s   &&&&&&       r   test_rectangle_minspanr   _   so   
 yyd6H"X ll44bX> ll44bX>? $$R0:.6KD 4BxbX6((((( 4xX6$$$$$! 4BxbX6(((((!!)!3!3V<<2<<2>>R>>RR<<r   zdrag_from_anywhere, new_centerFc                     \         P                  ! V R VR7      p\        VRRR7       VP                  R8X  g   Q h\        VRRR7       VP                  V8X  g   Q h\        VR	R
R7       VP                  R8X  g   Q hR# )T)rt   drag_from_anywhereru   Nr   
   rd   x   )2   A         #   r         r      )      )rg   rh   r   center)r   r   
new_centerrm   s   &&& r   test_rectangle_dragr      s|     $$RT8JLD 4wJ7;;(""" 4xX6;;*$$$ 4zz:;;*$$$r   c           	         \         P                  ! V R \        RRR7      \        RR7      R7      p\        VRRR7       VP                  pVP                  4       \        P                  ! RRR7      8X  g   Q hVP                  RR	R7       VP                  4       \        P                  ! RR	R7      8X  g   Q hVP                   F1  pVP                  4       R
8X  g   Q hVP                  4       R8X  d   K1  Q h	  VP                  RR	R7       VP                   F1  pVP                  4       R8X  g   Q hVP                  4       R	8X  d   K1  Q h	  R# )Tb皙?r"   alpha      ?r   )rt   rS   handle_propsru   r333333?black)markeredgecolorr   Nr   r   )rg   rh   dictr   _selection_artistget_facecolormcolorsto_rgba	set_props_handles_artistsget_markeredgecolor	get_alphaset_handle_propsr   rm   artists   &  r   .test_rectangle_selector_set_props_handle_propsr      s&   $$RT+/#S+I26S/CD 4wJ7##F!W__S%DDDDNNSN,!W__S%DDDD''))+w666!S((( ( 	#S9''))+s222!S((( (r   c                    \         P                  ! V R R7      p\        VRRR7       VP                  R8X  g   Q hVP                  pV^,          V^,          rCV^
,           V^,           re\        WV3WV3R7       VP                  V^ ,          WR^,          V38X  g   Q hVP                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           rCV^
,           Tre\        WV3WV3R7       VP                  V^ ,          WR^,          V^,          38X  g   Q hVP                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           rCV^,           Tre\        WV3WV3R7       VP                  WR^,          V^,          V^,          38X  g   Q hVP                  pV^ ,          V^,          rCV^,           V^,           re\        WV3WV3R7       VP                  WR^,          Wb^,          38X  g   Q hR# )Trt   ru   Nr   r   )        rc         $@      ^@)rg   rh   r   extents)r   rm   r   r[   r\   	xdata_new	ydata_news   &      r   test_rectangle_resizer      s   $$RT:D4wJ7<<4444 llG1:wqz5 2:uqyy4u~I3IJ<<GAJ	1:yIIII llG1:wqzWQZ'!*-D,II5 2:uy4u~I3IJ<<GAJ	1:wqzJJJJ llG1:wqzWQZ'!*-D,II5 2:uy4u~I3IJ<<Iqz71:wqzJJJJ llG1:wqz5 2:urzy4u~I3IJ<<Iqz9ajIIIIr   c                    \         P                  ! V R R7      p\        VR	R
R7       \        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       VP                  R4       VP                  R4       VP                  R4       R#   + '       g   i     L; i  + '       g   i     LX; i)Tr   ru   unsupported_stateNclearmovesquarer   F   r   }      )rg   rh   r   r9   raises
ValueError	add_stater   rm   s   & r   test_rectangle_add_stater      s    $$RT:D4xZ8	z	"	"*+ 
# 
z	"	"w 
#NN6NN8NN8 
#	" 
#	"s   	CC'C$	'C7	r   c                    \         P                  ! V R R7      p\        VRRR7       VP                  R	8X  g   Q hV'       d   VP	                  R4       RpMRpVP                  pV^,          V^,          re^
^rWW,           Wh,           r\        W%V3W3VR7       VP                  V^ ,          V,
          V	V^,          V,
          V
38X  g   Q hVP                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           re^
pWW,           Tr\        W%V3W3VR7       VP                  V^ ,          V,
          V	V^,          V^,          38X  g   Q hVP                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           reR
pWW,           Tr\        W%V3W3VR7       VP                  V^ ,          V,
          V	V^,          V^,          38X  g   Q hVP                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           re^pWW,           Tr\        W%V3W3VR7       VP                  W^,          V,
          V^,          V^,          38X  g   Q hVP                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           reRpWW,           Tr\        W%V3W3VR7       VP                  W^,          V,
          V^,          V^,          38X  g   Q hVP                  pV^ ,          V^,          re^^rWW,           Wh,           r\        W%V3W3VR7       VP                  W^,          V,
          W^,          V,
          38X  g   Q hR# )Tr   ru   r   Ncontrolrv   rw   keyr   r   )     Q@     @_@     @P@g     @`@rg   rh   r   r   r   r   r   rm   use_keyr   r[   r\   xdiffydiffr   r   s   &&         r   test_rectangle_resize_centerr      s\   $$RT:D4xZ8<<5555x  llG1:wqz5q5 =%-y4u~I3I <<GAJ.	#AJ.	; ; ; ; llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<GAJ.	#AJ
4 4 4 4 llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<GAJ.	#AJ
4 4 4 4 llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<IqzE'9#AJ
4 4 4 4 llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<IqzE'9#AJ
4 4 4 4 llG1:wqz5r5 =%-y4u~I3I <<IqzE'9%qzE'9; ; ; ;r   c                    \         P                  ! V R R7      p\        VRRR7       VP                  R	8X  g   Q hV'       d   VP	                  R4       RpMRpVP                  pV^,          V^,          re^
^rWW,           Wh,           r\        W%V3W3VR7       VP                  V^ ,          V	V^,          V^,          V,           38X  g   Q hVP                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           re^
pWW,           Tr\        W%V3W3VR7       VP                  V^ ,          V	V^,          V^,          V,           38X  g   Q hVP                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           reR
pWW,           Tr\        W%V3W3VR7       VP                  V^ ,          V	V^,          V^,          V,           38X  g   Q hVP                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           re^pWW,           Tr\        W%V3W3VR7       VP                  W^,          V^,          V^,          V,
          38X  g   Q hVP                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           reRpWW,           Tr\        W%V3W3VR7       VP                  W^,          V^,          V^,          V,
          38X  g   Q hVP                  pV^ ,          V^,          re^^rWW,           Wh,           r\        W%V3W3VR7       VP                  V^ ,          V,           V^,          W^,          38X  g   Q hR# )Tr   ru   r   Nshiftr   r   r   s   r   r   r   g     \@r   r   r   r   s   &&         r   test_rectangle_resize_squarer   .  s\   $$RT:D4xZ8<<5555x  llG1:wqz5q5 =%-y4u~I3I <<GAJ	#AJ
U(:< < < < llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<GAJ	#AJ
U(:< < < < llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<GAJ	#AJ
U(:< < < < llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<Iqz#AJ
U(:< < < < llG1:wqzWQZ'!*-D,II5E =%y4u~I3I <<Iqz#AJ
U(:< < < < llG1:wqz5r5 =%-y4u~I3I <<GAJ.
%qz3 3 3 3r   c                    \         P                  ! V R R7      p\        VRRR7       VP                  R4       VP                  R4       \	        VP
                  R4       VP
                  pV^,          V^,          rC^
^reW5,           WF,           r\        WV3Wx3R7       \	        VP
                  V^ ,          V,
          VV^,          V,
          V^,          V,           34       VP
                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           rC^
pW5,           Tr\        WV3Wx3R7       \	        VP
                  V^ ,          V,
          VV^,          V,
          V^,          V,           34       VP
                  pV^,          V^,          V^,          V^,          ,
          ^,          ,           rCR	pW5,           Tr\        WV3Wx3R7       \	        VP
                  V^ ,          V,
          VV^,          V,
          V^,          V,           34       VP
                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           rC^pW5,           Tr\        WV3Wx3R7       \	        VP
                  Wr^,          V,
          V^,          V,           V^,          V,
          34       VP
                  pV^ ,          V^,          V^,          V^,          ,
          ^,          ,           rCR
pW5,           Tr\        WV3Wx3R7       \	        VP
                  Wr^,          V,
          V^,          V,           V^,          V,
          34       VP
                  pV^ ,          V^,          rC^^reW5,           WF,           r\        WV3Wx3R7       \	        VP
                  V^ ,          V,           V^,          V,
          W^,          V,
          34       R# )Tr   ru   r   r   Nr   r   r   r   r   )rg   rh   r   r   r   r   )	r   rm   r   r[   r\   r   r   r   r   s	   &        r   #test_rectangle_resize_square_centerr   x  sQ   $$RT:D4xZ8NN8NN8DLL"<= llG1:wqz5q5 =%-y4u~I3IJDLL71:#5y#*1:#5wqzE7I#K L llG1:wqzWQZ'!*-D,II5E =%y4u~I3IJDLL71:#5y#*1:#5wqzE7I#K L llG1:wqzWQZ'!*-D,II5E =%y4u~I3IJDLL71:#5y#*1:#5wqzE7I#K L llG1:wqzWQZ'!*-D,II5E =%y4u~I3IJDLL9aj5.@#*1:#5wqzE7I#K L llG1:wqzWQZ'!*-D,II5E =%y4u~I3IJDLL9aj5.@#*1:#5wqzE7I#K L llG1:wqz5r5 =%-y4u~I3IJDLL71:#5wqzE7I#,aj5.@#B Cr   selector_classc                    V! V R R7      p\        VRRR7       VP                  R8X  g   Q h\        VP                  4      ^ 8X  g   Q h\	        VRRR7       VP                  R08X  g   Q h\        VP                  4      ^8X  g   Q h\        VRRR7       \	        VRRR7       \        VP                  4      ^ 8X  g   Q hVP                  R8X  g   Q h\        VP                  RRR	7       ^-Vn        VP                  ^-8X  g   Q h\        VP                  \        P                  ! . RO. RO.4      RR	7       \        VRRR7       \        VP                  RRR	7       V\        P                  8X  d?   \        P                  ! \        4      ;_uu_ 4        R
VP                  n        RRR4       R# R#   + '       g   i     R# ; i)Tr   ru   on_key_pressr   r   rotateg(\9@g{Gz?)atolunvalid_valueNrd   rd   r      rd   r   rd   r   )r      )gR]@     xa@g=
ףp[@g     V@)g     W@g=
ףp]@g     b@g(\^@)n   r   )r      )rd   r   rd   g
ףp=b@)r   r   len_stater   r   rotationcornersnparrayrg   rh   r9   r   r   r   rotation_point)r   r   rm   s   && r   test_rectangle_rotater     su    "$/D4zz:<<////t{{q    T>s+;;8*$$$t{{q   4zz:T>s+t{{q   <<////DMM5t4DM==BDLLHH==? @FJL
 4zz:DLL"<4H222]]:&&4CD""1 '& 3&&&s   F00G	c                 v   \         P                  ! V R R7      p\        VRRR7       VP                  R8X  g   Q h\	        VP
                  4      ^ 8X  g   Q hR F]  pVP                  V4       \	        VP
                  4      ^8X  g   Q hVP                  V4       \	        VP
                  4      ^ 8X  d   K]  Q h	  R# )Tr   ru   Nr   r   r   )r   r   r   )rg   rh   r   r   r   r   r   remove_state)r   rm   states   &  r   test_rectangle_add_remove_setr     s    $$RT:D4zz:<<////t{{q   /u4;;1$$$% 4;;1$$$	 0r   use_data_coordinatesc                 d   V P                  R 4       \        P                  ! V RVR7      p\        VR	R
R7       VP                  R8X  g   Q hVP                  R4       VP                  R4       V'       d   VP                  pV^,          V^,          V^,          V^ ,          ,
          rep^
V^,          V^,          V^,          ,
          ^,          ,           rWG,           TrV^,          V,           p\        W$V3W3R7       \        VP                  V^ ,          V,
          V	W,
          W,           .4       R# VP                  pV^,          V^,          rT^
pWG,           TrV^,          VP                  ,          p\        W$V3W3R7       \        VP                  V^ ,          V,
          V	RR.4       R# )皙?T)rt   r   ru   r   r   g      G@g     `@Nr   r   r   )
set_aspectrg   rh   r   r   r   r   _aspect_ratio_correction)r   r   rm   r   r[   r\   widthr   ycenterr   r   ychanges   &&          r   *test_rectangle_resize_square_center_aspectr    st   MM#$$RT:NPD 4xZ8<<5555NN8NN8,,%aj'!*gaj71:6MegajGAJ,Cq+HHw$}e9!)e#t5>	7MNwqzE'99'.'8':K'M 	N ,,qz71:u$}e9!)d;;;t5>	7MNwqzE'99',f'6 	7r   c                P   \         P                  ! V ^
RR7      pR
Vn        \        VRRR7       VP                  R8X  g   Q h\        VRRRR7       VP                  R8X  g   Q h\        VRRRR7       VP                   Uu. uF  p\	        V4      NK  	  ppV. RO8X  g   Q h\        VRRRR7       VP                   Uu. uF  p\	        V4      NK  	  ppV. RO8X  g   Q hVP
                  P                  R8X  g   Q h\        VP
                  R,          R^d.4       R	# u upi u upi )z'For ellipse, test out the key modifiersT)
grab_rangert   ru   r   r   r   z
ctrl+shiftr   Nrd      rd   r  r   r   )r   r   )r      r   r  r   )K   r   r  r   r   r   )r   r{   )r   r   r   r   r   )r   r   r   r   )r3   I   ):NNNr   )rg   EllipseSelectorr   r   intrj   shaper   )r   rm   er   s   &   r   test_ellipser  	  s   ""2"$GD'DL 4zz:<<//// 4zzyI<<---- 4xX7C#||,|!s1v|G,&&&& 4zz|L#||,|!s1v|G,((((==')))DMM$'#s4 -
 -s   D?D#c           	         \         P                  ! V ^
RRRRR/R7      pR	Vn        \        VP                  R
4       VP                  R	8X  g   Q h\        VP
                  R4       VP                  R	8X  g   Q h\        VRRR7       VP                  R8X  g   Q h\        VRRR7       VP                  R8X  g   Q h\        VRRR7       VP                  R8X  g   Q h\        P                  ! VP                  P                  ^ ,          P                  4       R4      '       g   Q h\        P                  ! VP                  P                  ^ ,          P                  4       R4      '       g   Q hR# )r   Tmarkerfacecolorr   r   r   )r
  rt   r   ru   Nr  ))rd   r  r  rd   )rd   rd   r  r  ))rd   r   r  r   )r   rd   r   r  r   )r   r   )r   r  r   r  )   r  )l      r  r  r  )r   rd   r   rd   )rg   rh   r   r   r   edge_centersr   r   
same_color_corner_handlesartistsget_markerfacecolorr   r   s   & r   test_rectangle_handlesr!  $  s`   $$RBD3Dc3Dc3KLD (DLDLL"NO<<////D%%HJ<<//// 4zz:<<//// 4zz:<<//// 4xZ8<<---- $$Q';;=sD D D D$$Q';;=sD D D Dr   rt   c                 ,   \         P                  ! \        R R7      p\        P                  ! WVR7      p\        VRRR7       VP                  4        VP                  R8X  g   Q hVP                  4        \        VRRR7       VP                  4        R # )NrU   )rX   rt   ru   rd   r   r  r   rc        b@g     [@r   r   rd   )	r   rf   r   rg   rh   r   rk   r   r   r   rt   rX   rm   s   &&  r    test_rectangle_selector_onselectr)  C  su     yyd6H$$RTD4zz:!<<77774yi8!r   ignore_event_outsidec                    \         P                  ! \        R R7      p\        P                  ! WVR7      p\        VRRR7       VP                  4        VP                  R8X  g   Q hVP                  4        \        VRRR7       V'       d&   VP                  4        VP                  R8X  g   Q hR # VP                  4        VP                  R	8X  g   Q hR # )
NrU   )rX   r*  ru   r#  r$  r%  r  r  r   r   )r&        d@r&  r.  )
r   rf   r   rg   rh   r   rk   r   r   r   )r   r*  rX   rm   s   &&  r   &test_rectangle_selector_ignore_outsider/  T  s    yyd6H$$R:NPD4zz:!<<77774zz:""$||;;;; 	##%||;;;;r   z$orientation, onmove_callback, kwargs
horizontal)minspanrK   vertical)rL   r   c                    \         P                  ! \        R R7      p\         P                  ! \        R R7      pV'       d   WSR&   V P                  R4       V P	                  4       p\
        P                  ! WV3/ VB p\        VR^d^d^R7       \        VR^^^R7       \        VR^^^R7       VP                  ^d^4       V'       d   VP                  ^d^4       R # R # )NrU   onmove_callbackautorY   rZ   r]   r^   )	r   rf   r   r  twinxrg   SpanSelectorr   assert_called_once_with)r   orientationr4  rJ   rX   r]   taxrm   s   &&&&    r   test_span_selectorr;  k  s     yyd6HYYDt4F$* ! MM&
((*CkDVDDT7#S;T83c!<T9Cs1=$$S#.&&sC0 r   c                 .   \         P                  ! \        R R7      p\        P                  ! WRVR7      p\        VRRR7       VP                  4        VP                  R8X  g   Q hVP                  4        \        VRRR7       VP                  4        R # )	NrU   r0  r   ru   r   )r  rd   )rd   r  r'  )	r   rf   r   rg   r7  r   rk   r   r   r(  s   &&  r   test_span_selector_onselectr=    sy    yyd6Hl,79D 4zz:!<<:%%%4yi8!r   c                 h   \         P                  ! \        R R7      p\         P                  ! \        R R7      p\        P                  ! WRVVR7      p\        VRRR7       VP                  4        VP                  4        VP                  R8X  g   Q hVP                  4        VP                  4        \        VRR	R7       V'       d6   VP                  4        VP                  4        VP                  R8X  g   Q hR # VP                  4        VP                  4        VP                  R
8X  g   Q hR # )NrU   r0  )r4  r*  ru   r   r  )rd   r   r,  r-  )r  r   )
r   rf   r   rg   r7  r   rk   r   r   r   )r   r*  rX   r]   rm   s   &&   r   !test_span_selector_ignore_outsider?    s    yyd6HYYDt4Fl065IKD 4zz:!
<<:%%%
4zz:""$  "||z))) 	##%!!#||z)))r   r   c                 B   \         P                  ! V \        R RVR7      p\        VRRR7       VP                  R8X  g   Q h\        VRR	R7       V'       d   VP                  R
8X  g   Q hMVP                  R8X  g   Q h\        VRRR7       VP                  R8X  g   Q hR# )r0  T)rX   	directionrt   r   ru   Nr  r   r'  r   r   )ry   r   )r   r   r   r   )rg   r7  r   r   r   )r   r   rm   s   && r   test_span_selector_dragrB    s     T\,03EGD 4xZ8<<9$$$ 4xX6||y(((||x''' 4zz:<<:%%%r   c                 R   \         P                  ! V \        R RR7      pVP                  R 8X  g   Q hVP                  P                  R 8X  g   Q h\
        P                  ! \        4      ;_uu_ 4        \         P                  ! V \        RR7      pRRR4       RVn        VP                  R8X  g   Q hVP                  P                  R8X  g   Q h\
        P                  ! \        4      ;_uu_ 4        RVn        RRR4       R#   + '       g   i     L{; i  + '       g   i     R# ; i)r0  T)rX   rA  rt   invalid_direction)rX   rA  Nr2  invalid_string)rg   r7  r   rA  _edge_handlesr9   r   r   r   s   & r   test_span_selector_directionrG    s    T\,02D>>\)))''<777	z	"	"##B.AC 
#  DN>>Z''''':555	z	"	") 
#	" 
#	" 
#	"	"s   1D0DD	D&	c                    \         P                  ! V \        R R\        RRR7      \        RR7      R7      p\	        VRRR7       VP
                  pVP                  4       \        P                  ! RRR7      8X  g   Q hVP                  R	R
R7       VP                  4       \        P                  ! R	R
R7      8X  g   Q hVP                   F1  pVP                  4       R8X  g   Q hVP                  4       R8X  d   K1  Q h	  VP                  R	R
R7       VP                   F1  pVP                  4       R	8X  g   Q hVP                  4       R
8X  d   K1  Q h	  R# )r0  Tr   r   r   r   r   )rX   rA  rt   rS   r   ru   r   r   r   r   Nr   r   )rg   r7  r   r   r   r   r   r   r   r   r   	get_colorr   r   r   s   &  r   )test_span_selector_set_props_handle_propsrK    s*   T\,0&*S&D-1_>D
 4wJ7##F!W__S%DDDDNNSN,!W__S%DDDD''!S(((!S((( ( 	3/''!S(((!S((( (r   selectorspan	rectanglec                    \        V R R7      pVR8X  d    \        P                  pRVR&   \        VR&   M\        P                  pV! R/ VB p\        VRRR7       \        VRRR7       VP                  '       d   Q hR VR&   V! R/ VB pVP                  '       g   Q h\        VRRR7       \        VRRR7       VP                  '       g   Q h\        VRR	R
7       VP                  '       d   Q hR# )T)r   rt   rM  r0  rA  rX   ru   r*  r   escaper   Nr   r  r   )r   r   )	r   rg   r7  r   rh   r   r~   r*  r   )r   rL  rJ   Selectorrm   s   &&   r   test_selector_clearrR    s    RT*F6''*{!z,,fD4xZ8 4zz:(((((%)F!"fD$$$$$4xZ8 4zz:$$$$$T>x0((((((r   c                 P   VR 8X  d!   \         P                  ! V \        RRRR7      pM\         P                  ! V RR7      p\	        VRRR7       VP
                  '       g   Q hVP                  4       '       g   Q hVR 8X  d   VP                  R	8X  g   Q hVP                  4        VP
                  '       d   Q hVP                  4       '       d   Q h\	        VRR
R7       VP
                  '       g   Q hVP                  4       '       g   Q hVR 8X  d   VP                  R8X  g   Q hR# R# )rM  r0  T)rX   rA  rt   r*  r   ru   Nr  r   r'  )r   r   )r   r   )	rg   r7  r   rh   r   r~   get_visibler   r   )r   rL  rm   s   && r   test_selector_clear_methodrU    s   6##B049=? ((>4xZ8$$$$$6||y(((JJL(((((!!!! 4xY7$$$$$6||x''' r   c                 >   \         P                  ! V \        R RR7      p\        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       VP                  R4       R#   + '       g   i     L; i  + '       g   i     Lr; i  + '       g   i     LI; i)r0  Tr   r   Nr   r   r   )rg   r7  r   r9   r   r   r   r   s   & r   test_span_selector_add_staterW  0  s    D,,02D 
z	"	"*+ 
#	z	"	"x  
#	z	"	"x  
# 	NN6 
#	"	"	"	"	"s$   C&=C99D&C6	9D		D	c                    . ROp\         P                  ! WRRR7      pVP                   F3  pVP                  4       '       d   Q hVP	                  4       '       g   K3  Q h	  VP                  R4       VP                  R4       VP                   F3  pVP                  4       '       g   Q hVP	                  4       '       d   K3  Q h	  VP                  V8X  g   Q hR# )ry   r0  F)rK   TN)ry   r{   r   )rg   ToolLineHandlesr  get_animatedrT  set_visibleset_animated	positions)r   r]  tool_line_handler   s   &   r   test_tool_line_handler_  >  s    I..rl7<> #**&&((((%%'''' +   &!!$'"**""$$$$!!#### + %%222r   rA  c                    \         P                  ! ^^4      w  rVP                  ^
^.^
^.4       VP                  P	                  4        VP                  4       pVP                  4       p\        P                  ! V\        V RR7      pVP                  4       V8X  g   Q hVP                  4       V8X  g   Q hV R8X  d   TMTpVP                  P                  \        V4      8X  g   Q hRpRpTp	\        WWVR7       VP                  4       V8X  g   Q hVP                  4       V8X  g   Q hV R8X  d   ^ M^p
Wz,          W,          .pVP                  P                  V8X  g   Q hR# )r6   Tr   r0  ru   N)rr   g      '@)      )r;   r<   plotr>   r?   
get_xbound
get_yboundrg   r7  printrF  r]  listr   )rA  rC   r   x_boundy_boundrm   bound
press_data	move_datarelease_dataindexhandle_positionss   &           r   test_span_selector_boundrp  Q  s3   ll1a GCGGRHr2hJJOOmmoGmmoGE9$GD==?g%%%==?g%%% L0GgE''4;666JIL4y9==?g%%%==?g%%%l*AE")<+>?''+;;;;r   QtAgg)skip_on_importerrorc            
       aa	a
 \         P                  ! ^ ^\         P                  ,          ^d4      o
\         P                  ! S
4      o	\        P
                  ! 4       w  rVP                  S
S	RR7      w  pVP                  . RR7      w  o\        P                  ! R4       VP                  V4       V P                  P                  V P                  4       VV	V
3R lp\        P                  ! WRVRRRR7      p^^.p^^.p\        VRV^ ,          V^,          ^R7       \        VR	V^ ,          V^,          ^R7       VP                  4       VS38X  g   Q hVP                   R
J g   Q hSP                   '       g   Q h\#        SP%                  4       R4       VP'                  4        SP                   R
J g   Q h^^ .p^^.p^^.p\        VRV^ ,          V^,          ^R7       \        VR	V^ ,          V^,          ^R7       VP                   R
J g   Q hSP                   '       g   Q h\#        SP%                  4       R4       \        VRV^ ,          V^,          ^R7       SP                   R
J g   Q hR# )zACheck that the animated artists changed in callbacks are updated.T)animated皙?c                    < \         P                  ! SW34      w  r#SW# P                  4       pSP                  S\         P                  ! SV4      4       R # r   )r   searchsortedmeanset_data	full_like)vminvmaxindminindmaxvln2valuesxs   &&   r   rx  :test_span_selector_animated_artists_callback.<locals>.mean~  sC    TL96!&&(QQ*+r   r0  )rA  r4  rt   r   rK   rY   rZ   r]   FgSG-?r^   NgȄC()r   linspacepisinr;   r<   rc  pausedraw_artistr>   blitbboxrg   r7  r   _get_animated_artistsstaler   	get_ydataupdate)rC   r   lnrx  rM  rk  rl  rm  r  r  r  s           @@@r   ,test_span_selector_animated_artists_callbackr  m  s    	Aq255y#&AVVAYFllnGC
''!Vd'
+CB7727%DC
 IIcNNN2JJOOCHH, L04,037(,	.D QJAIT7*Q-z!}QOT89Q<y|AN%%'B944488u9999CMMO%78KKM99 QJAIq6LT7*Q-z!}QOT89Q<y|AN88u9999CMMO%89T9LO?1.99r   c                 
   R  p\         P                  ! WRR7      pVP                  p\        P                  ! ^ ^^4      p\        P
                  ! . RO4      p\        P
                  ! . RO4      pV! WT4      p\        WV4       R# )c                      R # r   r   )argss   *r   rX   4test_snapping_values_span_selector.<locals>.onselect  s    r   r0  )rA  N)
gru  r   r   333333?ffffff??g
ףp=
@      @      @)
r   r   r   r   r   r         ?r  r  r  )rg   r7  _snapr   r  r   r   )r   rX   rm   snap_functionsnap_valuesr  expects   &      r   "test_snapping_values_span_selectorr    sf     FDJJM++aB'KXXJKFXXJKF6/FF#r   c                   a  V 3R  lp\         P                  ! ^24      ^,          p\        P                  ! S VRVR7      pRVn        VP                  R8X  g   Q hRVn        VP
                  e   Q hRVn        VP                  R8X  g   Q hR# )c                    < R Sn         R# )TN)_got_onselect)r{  r|  r   s   &&r   rX   )test_span_selector_snap.<locals>.onselect  s    r   r0  )rA  r  N)   r   )   $   )r   arangerg   r7  r   r  )r   rX   r  rm   s   f   r   test_span_selector_snapr    s      ))B-!#KH,79DDL<<8###D###DL<<8###r   c                     \         P                  ! V R  RRR7      pRVn        VP                  R8X  g   Q hVP                  '       g   Q hRpRp\	        WVR7       VP                  R8X  g   Q hR# )	c                     R # r   r   )ar   s   &&r   <lambda>,test_span_selector_extents.<locals>.<lambda>  s    r   r0  T)r*  ru   N)r2   r   )      )ry   r  )rg   r7  r   r~   r   )r   rm   rk  rm  s   &   r   test_span_selector_extentsr    sq    
|$
D DL<<7"""$$$$$ JL4|<<<7"""r   r   )r   )rK   rS   c                     \         P                  ! \        R R7      p\        P                  ! V 3RV/VB p\        VR^d^d^R7       \        VR^}^}^R7       \        VR^^^R7       VP                  . RO4       R # )NrU   rX   rY   rZ   r]   r^   )r   r  r,  )r   rf   r   rg   LassoSelectorr   r8  )r   rJ   rX   rm   s   &&  r   test_lasso_selectorr    sm     yyd6H  AhA&ADT7#S;T83c!<T9Cs1=$$%IJr   c           	         \         P                  ! \        R R7      p\        P                  ! W\        RRR7      R7      pVP                  p\        P                  ! VP                  4       R4      '       g   Q hVP                  4       R8X  g   Q hVP                  RRR7       \        P                  ! VP                  4       R4      '       g   Q hVP                  4       R8X  g   Q hR # )NrU   r   r   rI  )rX   rS   r   r   )r   rf   r   rg   r  r   r   r   r  rJ  r   r   )r   rX   rm   r   s   &   r   test_lasso_selector_set_propsr    s    yyd6H  '+#S'ACD ##Ff..0#6666$$$NNCN(f..0#6666$$$r   c                 R   \         P                  ! \        R R7      p\        P                  ! V R
V4      pVP
                  p\        P                  ! VP                  4       R4      '       g   Q hVP                  4       R8X  g   Q hVP                  4       ^8X  g   Q h\        P                  ! V R
V\        RRR^R7      R7      pVP
                  p\        P                  ! VP                  4       R4      '       g   Q hVP                  4       R8X  g   Q hVP                  4       ^8X  g   Q hVP                  4       R8X  g   Q hVP                  R4       VP                  R	4       \        P                  ! VP                  4       R4      '       g   Q hVP                  4       R	8X  g   Q hR # )NrU   r   -darkbluer   )	linestyler   r   lwrR   r   r   r   )r   rf   r   rg   Lassora   r   r  rJ  get_linestyleget_lwr   r   	set_color	set_alpha)r   rX   rm   ra   s   &   r   test_lasso_set_propsr    sT   yyd6H==Z2D99Ddnn.88883&&&;;=A==ZZsq:: ;D 99Ddnn.
;;;;>>s""";;=A3&&&NN3NN3dnn.4444>>s"""r   c                 V   Rp\         P                  ! WR4      pVP                  4       . RO8X  g   Q hVP                  ^ 4       VP                  4       . RO8X  g   Q hVP	                  4       R.8X  g   Q hVP                  4        VP                  4       . R	O8X  g   Q hVP	                  4       . 8X  g   Q hR
\        V4      \        V4      ^,           3 F@  p\        P                  ! \        4      ;_uu_ 4        VP                  VR7       RRR4       KB  	  R FA  p\        P                  ! \        4      ;_uu_ 4        VP                  ^VR7       RRR4       KC  	  VP                  R 4      pVP                  V4       R#   + '       g   i     K  ; i  + '       g   i     K  ; i)r  c)rn  N)r   c                      R # r   r   r   r   r   r  #test_CheckButtons.<locals>.<lambda>  s    4r   )r  r   r  )TFT)FFT)FFF)invalidr  )rg   r   
get_status
set_activeget_checked_labelsr   r   r9   r   r   	TypeError
on_clicked
disconnect)r   labelscheckinvalid_indexinvalid_valuecids   &     r   test_CheckButtonsr  	  s\   F  -@AE!4444	Q!5555##%#...	KKM!6666##%+++c&k3v;q=9]]:&&=1 '& : )]]9%%Qm4 &% ) 

<
(C	S '&& &%%s   8F>FFF(toolbarc                    \         P                  P                  R V4       \        P                  ! \
        RR7      p\        P                  ! \
        RR7      p\        P                  ! V R4      pVP                  V4       VP                  V4       VP                  R8X  g   Q h\        VR4       VP                  R4       VP                  R8X  g   Q hVP                  ^8X  g   Q hVP                  4        VP                  4        VP                  ^8X  g   Q h\        VRRRR7       \        VRR	R
7       \        VRRR
7       VP                  ^8X  g   Q hR# )r  NrU    _clickzx**2r   r[   r\   	_keypress+r   5)r;   rcParams_setr   rf   r   rg   TextBox	on_submiton_text_changetextr   set_val
call_countbegin_typingstop_typing)r   r  submit_eventtext_change_eventrm   s   &&   r   test_TextBoxr     s    LLi)99$T:L		t$???2r"DNN< )*99??T8LL99''1,,,""a'''T82R0T;C(T;C(''1,,,r   c                    \         P                  ! V R4      pVP                  ^4       VP                  R8X  g   Q hVP                  ^8X  g   Q hVP                  4        VP                  R 8X  g   Q hVP                  ^ 8X  g   Q hR# )Radio 1Radio 2Nr  r  zRadio 3)rg   r   r  value_selectedindex_selectedr   )r   radios   & r   test_RadioButtonsr  @  s|      %FGE	Q9,,,1$$$	KKM9,,,1$$$r   zcheck_radio_buttons.pngmpl20)styleremove_textc                     \        4       p V P                  R R7      pVP                  RR7       VP                  R4      p\        P
                  ! VR4      pVP                  R4      p\        P                  ! VRR4      pVP                  R4      p\        P
                  ! VRR. ROR. RO/R. ROR. RO/R7      pVP                  R4      p\        P                  ! VRRR. ROR. RO/R. ROR. RO/R. RO/R	7      p	R
# )Frootr   )leftr    r   r!   r"   r%   r&   r+   r,   N)皙?r  r   333333?r  )r  r   r   r  )zCheck 1zCheck 2zCheck 3)FTT)r  r   r   r  )   r  r  )r   greenblue)r#   	palegreen	lightblue)r  ru  r   r  )r	   
get_figuresubplots_adjustadd_axesrg   r   r   )
r   rC   rax1rb1rax2cb1rax3rb3rax4cb4s
             r   test_check_radio_buttons_imager
  J  s   	B
--U-
#CS!<<./D


t%F
GC<<./D


t%F24C <<./D


/68 ": "IK	LC <<./D


/1D68 ": "IK679Cr   png)
extensionsc                    \         P                  ! V P                  4       R R.4       VP                  . . R7      pVP	                  RR.RR.VP
                  \        P                  R,          ^,          ^,          RR.R7       VP                  RRR VP
                  R	R
7       VP                  RRRVP
                  R	R
7       R# )teacoffeexticksyticksr  	font.sizeC0rb   )r}   sr        ?r   r}   vaNUUUUUU?UUUUUU?)	rg   r   r<   add_subplotscatter	transAxesr;   r  r  fig_testfig_refr   s   && r   test_radio_buttonsr!  i  s    **,uh.?@			Br		2BJJSzC:,,{+a/A5$  IGGCer||GAGGCh",,8GDr   c                    R R.R^./pRRRRR^/p\         P                  ! VP                  4       RR	.W#R
7       \         P                  ! V P                  4       RR	.4      pVP                  V4       VP	                  / VCRR/C4       R# )r   r   r    r"   r  r!   r  	linewidthr  r  r%   r  N      b@)rg   r   r<   set_label_propsset_radio_props)r  r   r&   r'   cbs   &&   r   test_radio_buttons_propsr(  s  s    UGZ"6Kfk1MK))+eX->%0K 
		h//1E83D	EB{# 8+8sK89r   c           	      4   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! V RR.RRR/R7      pRRR4       \
        P                  ! XP                  P                  4       RR	.4      '       g   Q hR#   + '       g   i     LK; i)
z"Both the \*activecolor\* parameter)matchr  r  r   r"   r  )activecolorr'   Nrb   )	r9   warnsUserWarningrg   r   r   r  _buttonsr   )r   rbs   & r   !test_radio_button_active_conflictr0    s~    	kA
C 
C!!"uh&7U/:G.DF
C
 bkk779GV;LMMMM
C 
Cs   BB	c                     \         P                  ! VP                  4       R R.RR7       \         P                  ! V P                  4       R R.RR7      pRVn        R# )r  r  r  )r+  r   N)rg   r   r<   r+  )r  r   r'  s   && r   %test_radio_buttons_activecolor_changer2    sS    ))+eX->%,. 
		h//1E83D*/
1BBNr   c           	      (   \         P                  ! V P                  4       R R.RR.4       VP                  . . R7      pVP	                  RR.RR.RVP
                  \        P                  R,          ^,          ^,          RR.R7       VP	                  RR.RR.R	VP
                  \        P                  R,          ^,          ^,          R
R
.R7       VP                  RRR VP
                  RR7       VP                  RRRVP
                  RR7       R# )r  r  Tr  r  r  r  rb   )markerr}   r  r  r  kr  r   r  Nr  r  )	rg   r   r<   r  r  r  r;   r  r  r  s   && r   test_check_buttonsr6    s    **,uh.?$N			Br		2BJJSzC:cR\\,,{+a/A5&&9I  KJJSzC:cR\\,,{+a/A5#s  EGGCer||GAGGCh",,8GDr   c           	         R R.R^./pRRRRR^/pRRR^/p\         P                  ! VP                  4       RR	.R
R
.W#VR7       \         P                  ! V P                  4       RR	.R
R
.4      pVP                  V4       VP	                  / VCRR/C4       VP                  R4      VR&   VP                  / VCRR/C4       R# )r   r   r    r"   r  r!   r  r#  r  r  Tr  r  Nr$  )rg   r   r<   r%  set_frame_propspopset_check_props)r  r   r&   r+   r,   r'  s   &&    r   test_check_button_propsr;    s    UGZ"6Kfk1MK{A6K))+eX->t%0%02 
		h//1E83D#Tl
,B{# 8+8sK89  +{;K8+8sK89r   c            
         \         P                  ! 4       w  r\        P                  ! \        4      ;_uu_ 4        \
        P                  ! VR RRRR7       RRR4       \        P                  ! \        4      ;_uu_ 4        \
        P                  ! VR RRRR7       RRR4       R#   + '       g   i     LX; i  + '       g   i     R# ; i)r  r         8@r   )r   labelvalminvalmax	sliderminN)r   r>  r?  r@  	slidermax)r;   r<   r9   r   r   rg   Slider)rC   r   s     r   'test_slider_slidermin_slidermax_invalidrD    s    llnGC	z	"	""Bs4!%	' 
# 
z	"	""Bs4!%	' 
#	" 
#	" 
#	"	"s   B& B9&B6	9C
	c            	      N   \         P                  ! 4       w  r\        P                  ! VR RRRR7      p\        P                  ! VR RRRVR7      pVP                  VP                  8X  g   Q h\        P                  ! VR RRRVR7      pVP                  VP                  8X  g   Q hR	# )
r  r   r=  r  r   r>  r?  r@  valinitr  )r   r>  r?  r@  rG  rA  r   )r   r>  r?  r@  rG  rB  Nr;   r<   rg   rC  val)rC   r   slider_sliders       r   test_slider_slidermin_slidermaxrL    s    llnGCnn"S%(*G ^^rC$'7<F::$$$^^rC$(G=F::$$$r   c                     \         P                  ! 4       w  r\        P                  ! VR RRRR7      pVP                  VP
                  8X  g   Q h\        P                  ! VR RRRR7      pVP                  VP                  8X  g   Q hR# )r  r   r=  rF  g      9@Ng      $)r;   r<   rg   rC  rI  r?  r@  rC   r   rK  s      r   test_slider_valmin_valmaxrO    sm    llnGC^^rC$)+F::&&&^^rC$(*F::&&&r   c            	          \         P                  ! 4       w  r\        P                  ! VR RRR^R7      pVP                  ^8X  g   Q h\        P                  ! VR RRR. ROR7      pVP                  R8X  g   Q hR# )r  r   r=  g&@)r   r>  r?  r@  rG  valstepr  N)r   r6   r  g333333@rH  rN  s      r   test_slider_valstep_snappingrR    sk    llnGC^^rC$(!5F::^^rC$(2CEF::r   c            	         \         P                  ! 4       w  r\        P                  ! VR ^ ^^RR7      pVP	                  ^
4       VP
                  ^
8X  g   Q hVP                  P                  4       P                  VP                  P                  4       4      p\        VP                  . RO4       \         P                  ! 4       w  r\        P                  ! VR ^ ^^RR7      pVP	                  ^
4       VP
                  ^
8X  g   Q hVP                  P                  4       P                  VP                  P                  4       4      p\        VP                  . RO4       R# )r  r0  )r   r>  r?  r@  rG  r9  r2  N)r   r  竪?r   )r  r   r   rT  )r;   r<   rg   rC  r  rI  polyget_extentstransformedr  invertedr   bounds)rC   r   rK  boxs       r   test_slider_horizontal_verticalr[    s   llnGC^^rAb$&LBF
NN2::
++
!
!
#
/
/0E0E0G
HCCJJ 34llnGC^^rAb$&J@F
NN2::
++
!
!
#
/
/0E0E0G
HCCJJ 34r   c                      \         P                  ! 4       w  r\        P                  ! VR ^ ^RR7      pVP	                  R4       VP                  4        VP                  R8X  g   Q hR# )r  r   rF        ?N)r;   r<   rg   rC  r  resetrI  rN  s      r   test_slider_resetr_    sL    llnGC^^rAaLF
NN4
LLN::r   r9  c           	      X  a  S R 8X  d   . R	OpM. R
Op\         P                  ! 4       w  r#\        P                  ! VRRRS RR.R7      pVP                  P                  4       P                  VP                  P                  4       4      p\        VP                  4       P                  4       V,          . RO4       \        VP                  R4       V 3R lpVP                  R4       \        VP                  R4       \        V! V4      R4       VP                  P                  4       P                  VP                  P                  4       4      p\        VP                  4       P                  4       V,          . RO4       VP                  R4       \        VP                  R4       \        V! V4      R4       VP                  R4       \        VP                  R4       \        V! V4      R4       VP                  4        \        VP                  R4       \        V! V4      R4       R# )r2  r  r   r  ru  (\?r   r>  r?  r@  r9  rG  c                    < SR 8X  d1   V P                    Uu. uF  qP                  4       ^ ,          NK  	  up# V P                    Uu. uF  qP                  4       ^ ,          NK  	  up# u upi u upi )r2  )_handlesr  	get_xdata)rK  hr9  s   & r   ro  +test_range_slider.<locals>.handle_positions  s]    *$.4oo>oKKM!$$o>>.4oo>oKKM!$$o>> ?>s   A)A.Nr6   r      r3   r   r6   r3   ri  )ru  r  ra  r]  )ru  ra  )皙?r  )rk  r  r  r]  )r   ru  )ru  r   )r  r   r5   )r;   r<   rg   RangeSliderrU  rV  rW  r  rX  r   
get_pointsflattenrI  r  r^  )r9  idxrC   r   rK  rZ  ro  s   f      r   test_range_sliderrp    s   j llnGC  RC[dF ++
!
!
#
/
/0E0E0G
HCCNN$,,.s35LM FJJ,? NN:FJJ
+$V,j9
++
!
!
#
/
/0E0E0G
HCCNN$,,.s35IJ
NN:FJJ
+$V,j9
NN8FJJ'$V,f5
LLNFJJ,$V,k:r   c           	      t   V R 8X  d   . ROpM. ROp\         P                  ! 4       w  r#\        P                  ! VRRRV ^ ^ .R7      pVP                  P                  4       P                  VP                  P                  4       4      p\        VP                  4       P                  4       V,          . RO4       R# )	r2  r  r   r  rb  Nrh  rj  )r   r  r   r]  )r;   r<   rg   rl  rU  rV  rW  r  rX  r   rm  rn  )r9  ro  rC   r   rK  rZ  s   &     r   "test_range_slider_same_init_valuesrr  1  s    j llnGC  bSkQF ++
!
!
#
/
/0E0E0G
HCCNN$,,.s35GHr   c                   \        4       p\        P                  ! \        RR7      p\        P
                  ! V3RV/VB pV  F  w  rx\        Wg3/ VB  K  	  VP                  V8X  g   Q hVP                  V3/ 38X  g   Q hR# )a  
Helper function to test Polygon Selector.

Parameters
----------
event_sequence : list of tuples (etype, dict())
    A sequence of events to perform. The sequence is a list of tuples
    where the first element of the tuple is an etype (e.g., 'onmove',
    'press', etc.), and the second element of the tuple is a dictionary of
     the arguments for the event (e.g., xdata=5, key='shift', etc.).
expected_result : list of vertices (xdata, ydata)
    The list of vertices that are expected to result from the event
    sequence.
selections_count : int
    Wait for the tool to call its `onselect` function `selections_count`
    times, before comparing the result to the `expected_result`
**kwargs
    Keyword arguments are passed to PolygonSelector.
NrU   rX   )	r	   r   rf   r   rg   PolygonSelectorr   r  rl   )	event_sequenceexpected_resultselections_countrJ   r   rX   rm   etype
event_argss	   &&&,     r   check_polygon_selectorrz  B  s    * 
Byyd6H""2CCFCD-+
+  . "2222?"5r!::::r   c                 T    R \        WR7      3R\        WR7      3R\        WR7      3.# )r]   r  rY   r^   r   r  s   &&r   polygon_place_vertexr}  d  s3    t%56d455679 9r   c           	      X    R \        WR7      3R\        W^R7      3R\        W^R7      3.# )r]   r  rY   rZ   r^   r|  r  s   &&r   polygon_remove_vertexr  j  s9    t%56dA>?5a@AC Cr   draw_bounding_boxc                    \         P                  ! \        V R 7      p. ROp. \        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OpV! W2^4       . ROp. \        ^2^24      O\        ^^24      OR\	        RR7      3NR\	        ^2^2R7      3NR\	        ^2^2R7      3NR\	        ^K^2R7      3NR\	        ^K^2R7      3NR\	        RR7      3N\        ^2^4      O\        ^K^24      OpV! W2^4       . ROp. \        ^2^24      O\        ^^24      OR\	        R	R7      3NR\	        ^d^dR7      3NR\	        ^d^dR7      3NR\	        ^d^}R7      3NR\	        ^d^}R7      3NR\	        R	R7      3N\        ^2^4      O\        ^2^K4      OpV! W2^4       . ROp. \        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OR\	        ^2^2R7      3NR\	        ^2^2R7      3NR\	        ^K^2R7      3NR\	        ^K^2R7      3NpV! W2^4       . ROp. \        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OR\	        R	R7      3NR\	        ^d^dR7      3NR\	        ^d^dR7      3NR\	        ^}^}R7      3NR\	        ^}^}R7      3NR\	        R	R7      3NpV! W2^4       . ROpR\	        RR7      3R\	        ^d^dR7      3R\	        ^d^dR7      3R\	        ^}^}R7      3R\	        ^}^}R7      3R\	        RR7      3R\	        R	R7      3R\	        ^d^dR7      3R\	        ^d^dR7      3R\	        ^}^}R7      3R\	        ^}^}R7      3R\	        R	R7      3.\        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OpV! W2^4       . ROp. \        ^2^24      O\        ^^24      OR\	        R
R7      3NR\	        R
R7      3N\        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OpV! W2^4       R# )r  r   r   r   r]   r  rY   r^   on_key_releaser   rP  Nr   r   r  r   r   r  ))r  r   r  r  ))r   r  )r  r  r  ))r  r  )r   r  )r  r   )	functoolspartialrz  r}  r   )r  check_selectorrv  ru  s   &   r   test_polygon_selectorr  p  sa   &&2CEN 7O	b"	%	c2	& 
b#	& 
b"	%	N >A6 7O	b"	%	c2	& 
),- 
4b+,	
 
$Rr*+ 
4b+, 
Dr,- 
4I./ 
b#	& 
b"	%N >A6 7O	b"	%	c2	& 
'*+ 
4c-.	
 
$S,- 
4c-. 
Ds#./ 
4G,- 
b#	& 
b"	%N >A6 7O		b"	%		c2	&	 
b#	&	 
b"	%		
 
4b+,	 
$Rr*+	 
4b+,	 
Dr,-	N >A6 7O	b"	%	c2	& 
b#	& 
b"	%	
 
'*+ 
4c-. 
$S,- 
4c-. 
Ds#./ 
4G,-N >A6 7O	),-	4c-.	$S,-	4c-.	Ds#./	4I./	'*+	4c-.	$S,-	4c-.	Ds#./	4G,- 
b"	% 
c2	& 
b#	&  
b"	%!N$ >A6 7O		b"	%		c2	&	 
(+,	 
4H-.		
 
b"	%	 
c2	&	 
b#	&	 
b"	%	N >A6r   c                    \         P                  ! V \        R RR7      \        RR7      VR7      p. \        ^2^24      O\        ^^24      O\        ^2^4      O\        ^2^24      OpV F  w  rE\	        W$3/ VB  K  	  VP
                  pVP                  4       R 8X  g   Q hVP                  4       R8X  g   Q hVP                  RRR7       VP                  4       R8X  g   Q hVP                  4       R8X  g   Q hVP                   F1  pVP                  4       R 8X  g   Q hVP                  4       R8X  d   K1  Q h	  VP                  RRR7       VP                   F1  pVP                  4       R8X  g   Q hVP                  4       R8X  d   K1  Q h	  R# )	r   r   rI  r   r   )rS   r   r  r   r   N)rg   rt  r   r}  r   r   rJ  r   r   r   r   )r   r  rm   ru  rx  ry  r   s   &&     r   ,test_polygon_selector_set_props_handle_propsr    s   ""2)-Cs)C0435FHD
	b"	%	c2	& 
b#	& 
b"	%	N  .+
+  . ##F$$$$$$NNCN($$$$$$''!S(((!S((( ( 	3/''!S(((!S((( (r   c                     V P                  4       pVP                  4       p\        P                  ! VR R/R7      pRVn        R# )visibleFrR   N)r   r  r   r  )r<   rg   rh   r   )r  r   ax_test_rm   s   &&   r   test_rect_visibilityr    s>     !GA$$WY4FGD'DLr   ro  c                 `   . ROp\        V^ ,          !  \        V^,          !  \        V^,          !  \        V^ ,          !  .pVP                  V \        ^^4      4       VP                  \        ^^4      4       \        P
                  ! \        P                  V. 4      p\        W2^VR7       R# )r   r  Nr  )	r}  insertappendr  r  reduceoperatoriaddrz  )ro  r  vertsru  s   &&  r   test_polygon_selector_remover    s     -E*E!H5*E!H5*E!H5*E!H5	7N #3C=>/S9:%%hmm^RHN>!->@r   c                     . ROp. \        V^ ,          !  O\        V^,          !  O\        V^,          !  O\        V^ ,          !  O\        V^ ,          !  Op\        W!R,          ^V R7       R# )r   :r6   NNr  Nr  )r}  r  rz  )r  r  ru  s   &  r   (test_polygon_selector_remove_first_pointr  !  s    ,E	uQx	(	uQx	( 
uQx	( 
uQx	(	
 
a	)N >9a->@r   c                    . ROp. \        V^ ,          !  O\        V^,          !  O\        V^,          !  O\        V^ ,          !  O\        V^,          !  O\        V^,          !  O\        V^,          !  Op\        P                  ! WR7      pV F  w  rV\	        WE3/ VB  K  	  VP
                  VR,          8X  g   Q hR# )r   r  :r   r3   NNr  )r}  r  rg   rt  r   r  )r   r  r  ru  rm   rx  ry  s   &&     r   test_polygon_selector_redrawr  /  s    ,E
	uQx	(
	uQx	(
 
uQx	(
 
uQx	(	
 
a	)
 
a	)
 
uQx	(
N ""2KD-+
+  . ::s###r   c                    . ROpV P                  4       p\        P                  ! WBR7      pW5n        VP                  V8X  g   Q hVP                  4       p\        P                  ! WbR7      p. \	        V^ ,          !  O\	        V^,          !  O\	        V^,          !  O\	        V^ ,          !  OpV F  w  r\        Wy3/ V
B  K  	  R# )ru  r  N))ru  rk  )r   r  )r   r   )r  rg   rt  r  r}  r   )r  r   r  r  r  	tool_testax_reftool_refru  rx  ry  s   &&&        r   "test_polygon_selector_verts_setterr  F  s     1E""$G''UIO??e###  "F&&vSH	uQx	(	uQx	( 
uQx	( 
uQx	(	N  ./J/  .r   c                 &   V P                  R	R	R7       . R
Op. \        V^ ,          !  O\        V^,          !  O\        V^,          !  O\        V^,          !  O\        V^ ,          !  Op\        P                  ! V RR7      pV F  w  rE\	        W43/ VB  K  	  V P
                  pV P                  RR7      P                  p\        RV.VP                  R4      O^N5!  P                  4        \        RV.VP                  R4      O5!  P                  4        \        RV.VP                  R4      O^N5!  P                  4        \        P                  P                  VP                  . RO4       \        RV.VP                  R4      O^N5!  P                  4        \        RV.VP                  R4      O5!  P                  4        \        RV.VP                  R4      O^N5!  P                  4        \        P                  P                  VP                  . RO4       \        P                  P                  VP                  P                   R4       \        RV.VP                  R4      O^N5!  P                  4        \        RV.VP                  R4      O^N5!  P                  4        \        P                  P                  VP                  . RO4       \        P                  P                  VP                  P                   R4       R# )r   )xlimylimTr  r  button_press_eventmotion_notify_eventbutton_release_eventN)ir   ))ry   r   )r   ry   )ry   (   )r  ry   )r  r  rx   ))r   r   r   )r   ry   )ry   r   r  rz   r{   ry   )r  ry   r{   r{   r  r  r{   )      4@      D@r  r  )r  r  r  )r  r  g      >@r  )setr}  rg   rt  r   r|   r  r>   r   r}   _processr   testingr   r  _boxr   )r   r  ru  rm   rx  ry  tr>   s   &       r   test_polygon_selector_boxr  \  s   FF		F*2E	uQx	(	uQx	( 
uQx	( 
uQx	(	
 
uQx	(N ""2>D-+
+  .
 	A]]]%,,F fA'({{8'<A>?AAIv?()H(=??GxzC)*X)>C@ACCK8:JJ

:< fA'({{8'<A>?AAIv?()H(=??GxzC)*X)>C@ACCK8:JJ

<> JJ		35 fA'({{8'<A>?AAIC)*X)>C@ACCK8:JJ

24JJ		35r   c                    \         P                  ! \        R R7      p\        P                  ! W4      p. RO. RO3 EF  pV F%  w  rE\        WE4       F  w  rg\        W&3/ VB  K  	  K'  	  VP                  pVP                  '       g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q h\        P                  P                  VP                  4       V4       VP                  VR R 3/ 38X  g   Q hVP                  4        VP                  '       d   Q h\        P                  P                  VP                  4       R.4       EK  	  R # )NrU   )r  r  r  r  )r  )rd   r   r  r  r  r4   )r   rf   r   rg   rt  r}  r   r   r~   rT  r   r  assert_equal
get_xydatarl   r   )	r   rX   rm   resultr  yrx  ry  r   s	   &        r   "test_polygon_selector_clear_methodr    s!   yyd6H""20D==?DA%9!%?!3
3 &@  ''(((((!!!!!!####


 1 1 3V<!!vcr{nb%9999

,,,,,


 1 1 3fX>!?r   horizOnvertOnc                 l   \         P                  ! 4       pVP                  ^RR7      w  r4\         P                  ! 4       P                  4       p\        P                  ! RW53RWR7      p\        VP                  4      ^8X  g   Q h\        VP                  4      ^8X  g   Q h\        VRRR7      pVP                  V4       VP                  P                  4        VP                   F  pVP                  4       R
8X  d   K  Q h	  VP                   F  pVP                  4       R8X  d   K  Q h	  \        VP                   U	u. uF  qP                  4       '       g   K  V	NK  	  up	4      V'       d   ^M^ 8X  g   Q h\        VP                   U	u. uF  qP                  4       '       g   K  V	NK  	  up	4      V '       d   ^M^ 8X  g   Q hVP                  '       * Vn        VP                   '       * Vn        \        VRRR7      pVP                  V4       \        VP                   U	u. uF  qP                  4       '       g   K  V	NK  	  up	4      V'       d   ^ M^8X  g   Q h\        VP                   U	u. uF  qP                  4       '       g   K  V	NK  	  up	4      V '       d   ^ M^8X  g   Q h\        VR	R	R7      pVP                  V4       VP                   F  pVP                  4       R
8X  d   K  Q h	  VP                   F  pVP                  4       R8X  d   K  Q h	  R# u up	i u up	i u up	i u up	i )r3   T)sharexNF)rK   r  r  r   r  r  r]  )r   r   )r  r  )r;   figurer<   rg   MultiCursorr   vlineshlinesr
   r]   r>   r?   re  r  rT  r  r  )
r  r  rC   ax1ax3ax2multieventlra   s
   &&        r   test_MultiCursorr    s    **,Ca-JS
**,


!C sj%E
 u||!!!u||!!!
 s"C0E	LLJJOO \\{{}((( \\{{}
***  D1A1A1CDE  D1A1A1CDE!   %EM||#ELs"C0E	LLD1A1A1CDE  D1A1A1CDE!  
 s#S1E	LL\\{{}((( \\{{}
*** + ED EDs0   L"L"L'*L'&L,L,3L1L1)<   r  r  )r0  r2  )rb   toolbar2toolmanager)r6   r3   ri  )gr  r@   r  unittestr   matplotlib.backend_basesr   matplotlib.colorscolorsr   r7   rg   matplotlib.pyplotpyplotr;   matplotlib.testing.decoratorsr   r   matplotlib.testing.widgetsr   r   r	   r
   r   numpyr   numpy.testingr   r9   fixturer   rI   markparametrizer   rp   r   r   r   r   r   r   r   r   rh   r  r   r   r  r  r!  r)  r/  r;  r=  r?  rB  rG  rK  rR  rU  rW  r_  rp  backendr  r  r  r  r  r  r  r  r  r  r
  r!  r(  r0  r2  r6  r;  rD  rL  rO  rR  r[  r_  rp  rr  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r   r   r   <module>r     s    	   / # $  O: :  )   $0N Fa "rh7t	$ 2 '9:1b'At9q"g)FG1b'At9q"g)FG  H H ; F 9* (+-.%.%*)* JF tUm4F; 5F;R tUm4F3 5F3R<C~ )!33W5L5LMODODB
% /%?7 @7B56D> u6" 7"  /$?< @<, ?5$r489t1~&5$Tt_565$401	B 110 u6" 7" /$?* @*8 -e}=& >&2*$), fk%:;) <): fk%:;( <(23& &@A< B<6 W$75 85p$$"#" Fd/0a $ 
K
K%#*. $GH- I->% ,-W$O9 P9< (E )E (: ):N ( ) (E )E (: ):,'%'5( z(BC); D);X z(BCI DI ;D9C ,udm<n7 =n7b ,udm<) =)@ (( )( 	*,udm<@ = +@" ,udm<
@ =
@ ,udm<$ =$, ,udm<(0 ) =0(55p?. UDM2E4=12+ 2 32+r   