+
    i^                        ^ RI t ^ RIt^ 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Ht ]P"                  P%                  R4      .tRXR ltRYR lt]! R.RR	7      R
 4       t]! R.RR	7      R 4       t]! R.RR	7      R 4       t]! R.RR	7      R 4       t]! R.RR	7      R 4       t]! R.RR	7      R 4       tR tR t]! R.RR	7      R 4       t]! R.RR	7      R 4       t]! R.R]P@                  ! 4       R8X  d   ^ MRR7      R 4       t!]! R .RR	7      R! 4       t"]! R".RR	7      R# 4       t#]! R$.RR	7      R% 4       t$]! R&.RR	7      R' 4       t%]! R(.RR	7      R) 4       t&]! R*.RR	7      R+ 4       t']! R,.RR	7      R- 4       t(]! R..RR	7      R/ 4       t)R0 t*R1 t+R2 t,R3 t-R4 t.R5 t/]! R6.R7RR87      R9 4       t0R: t1R; t2]! R<.RR	7      R= 4       t3]! R>.RR	7      R? 4       t4R@ t5]! RA.R7RRBRC/RD7      RE 4       t6]! RF.R7RRB]Pn                  ! RG^ .RH^..4      /RD7      RI 4       t8RJ t9RK t:RL t;RM t<RN t=RO t>RP t?RQ t@]P"                  P                  RRRZR[/ R73RSR/R73.4      RT 4       tBRU tCRV tDRW tER# )\    N)image_comparison)gridspectickertext_placeholdersc                    V P                  ^^.4       V P                  ^R7       V'       g<   V P                  RVR7       V P                  RVR7       V P	                  RVR7       R# V P                  . 4       V P                  . 4       R# )   nbinsx-labelfontsizey-labelTitleN)plotlocator_params
set_xlabel
set_ylabel	set_titleset_xticklabelsset_yticklabels)axr   nodecs   &&&ڇ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_constrainedlayout.pyexample_plotr      sq    GGQFOA
i(3
i(3
Wx0
2
2    c           
         R R r2\         P                  \        R^V,           V4      \        R^V,           V4      3,          w  rE^VR,          ,
          V^,          ,           V^,          ,           \         P                  ! V^,          ) V^,          ,
          4      ,          pV P	                  WTVRR1RR13,          RRRRR7      pV P                  RVR7       V P                  R	VR7       V P                  R
VR7       V# )333333?       @NRdBu_r      ?T)cmapvminvmax
rasterizedr   r   r   r   g      )npmgridsliceexp
pcolormeshr   r   r   )r   r   dxdyyxzpcms   &&      r   example_pcolorr2      s    #88E"a"fb)"a"fb)* +DA	
QVa1f	qAv	%a!q&0@)AAA
--aSbSks#'  )CMM)hM/MM)hM/LL8L,Jr   zconstrained_layout1.pngmpl20)stylec                 n    \         P                  ! RR7      p V P                  4       p\        V^R7       R# )z,Test constrained_layout for a single subplotconstrainedlayoutr   N)pltfigureadd_subplotr   figr   s     r   test_constrained_layout1r>   ,   s(     **M
*C		Bb!r   zconstrained_layout2.pngc                 |    \         P                  ! ^^RR7      w  rVP                   F  p\        V^R7       K  	  R# )z(Test constrained_layout for 2x2 subplotsr6   r7   r   N)r9   subplotsflatr   r=   axsr   s      r   test_constrained_layout2rD   4   s0     ||Aq7HChhR"% r   zconstrained_layout3.pngc                     \         P                  ! ^^RR7      w  r\        VP                  4       F1  w  r#\	        V^R7      pV^8X  d   RpMRpV P                  WCVR7       K3  	  R# )z3Test constrained_layout for colorbars with subplotsr6   r7   r   g{Gz?{Gz?)r   padN)r9   r@   	enumeraterA   r2   colorbar)r=   rC   nnr   r1   rG   s         r   test_constrained_layout3rK   <   sZ     ||Aq7HCCHH%R"-7CCSS) &r   zconstrained_layout4.pngc                     \         P                  ! ^^RR7      w  rVP                   F  p\        V^R7      pK  	  V P	                  XVRRR7       R# )z;Test constrained_layout for a single colorbar with subplotsr6   r7   r   {Gz?r   r   rG   shrinkNr9   r@   rA   r2   rI   r=   rC   r   r1   s       r   test_constrained_layout4rR   J   sF     ||Aq7HChhR"- LL$sL3r   zconstrained_layout5.pngc            	         \         P                  ! ^^RR7      w  rVP                   F  p\        V^R7      pK  	  V P	                  XVRRRRR7       R	# )
zN
Test constrained_layout for a single colorbar with subplots,
colorbar bottom
r6   r7   r   FrM   r   bottom)r   use_gridspecrG   rO   locationNrP   rQ   s       r   test_constrained_layout5rW   T   sQ     ||Aq7HChhR"- LL#c"  $r   zconstrained_layout6.pngc                    \         P                  ! RR7      p V P                  ^^V R7      pV^ ,          P                  ^^4      pV^,          P                  ^^4      p. pV F*  pV P	                  V4      pWE.,          p\        V^R7       K,  	  XP                  R4       . pV F*  pV P	                  V4      pWe.,          p\        V^R7      pK,  	  V P                  XVRRR\        P                  ! ^R	7      R
7       R# )z,Test constrained_layout for nested gridspecsr6   r7   r:   r   zx-label
MultiLinerM   gGz?rT   r	   )r   rG   rO   rV   ticksN)r9   r:   add_gridspecsubgridspecr;   r   r   r2   rI   r   MaxNLocator)r=   gsgslgsraxslr   axsrr1   s           r   test_constrained_layout6rc   c   s     **M
*C			!Qs		+B
Q%

Aq
!C
Q%

Aq
!CD__R R"%  MM&'D__R R"- 
 LL$))2  4r   c                     \         P                  ! R R7      p V P                  ^^4      pV^ ,          P                  ^^4      pV^,          P                  ^^4      p. p. p\	        ^4       F?  pW@P                  W&,          4      .,          pWPP                  W6,          4      .,          pKA  	  V P                  4        V^ ,          P                  4       P                  V^ ,          P                  4       P                  8  g   Q hR# )Tconstrained_layoutN)
r9   r:   r[   r\   ranger;   draw_without_renderingget_positiony0y1)r=   GSGSAGSBaxaaxbis          r   test_identical_subgridspecrr   {   s    
**
-C			!Q	B
Q%

Aq
!C
Q%

Aq
!C
C
C1X'(('((   q6 ##c!f&9&9&;&>&>>>>r   c                    \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! RR7      p \
        P                  ! ^^4      p\
        P                  ! ^^V^ ,          4      p\
        P                  ! ^^V^,          4      pV F  pV P                  V4       K  	  V P                  4        RRR4       R#   + '       g   i     R# ; i)z2Test for proper warning if fig not set in GridSpeczhThere are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keywordmatchr6   r7   N)
pytestwarnsUserWarningr9   r:   r   GridSpecGridSpecFromSubplotSpecr;   rh   )r=   r^   r_   r`   s       r   test_constrained_layout7r{      s    	 3
5 
5 jj.q!$..q!RU;..q!RU;BOOB  	""$
5 
5 
5 
5s   BCC	zconstrained_layout8.pngc                    \         P                  ! R
RR7      p \        P                  ! ^^V R7      p. pR F  pV^ 8X  d   ^.pM^ ^.pV Fs  pV P	                  WV3,          4      pW&.,          p\        V^	R7       V^ 8  d   VP                  R4       V^8  d   VP                  R4       VP                  R4       Ku  	  K  	  V P	                  VR,          4      pW&.,          p\        V^	R7      pV P                  WrRRR7       R	# )z/Test for gridspecs that are not completely fullr6   figsizer8   rY   r    rM   r   rN   N)
      r   r   )   NNN)
r9   r:   r   ry   r;   r2   r   r   r   rI   )r=   r^   rC   jilistrq   r   r1   s           r   test_constrained_layout8r      s     **W]
;C			1a	,B
C6CEFEAqD*B4KC2*1ub!1ub!LL   
D	"B4KC
a
(CLL$sL3r   zconstrained_layout9.pngc                 6   \         P                  ! ^^RRRR7      w  rVP                   F2  p\        V^R7      pVP	                  R4       VP                  R4       K4  	  XP                  R4       V P                  XVRRR	7       V P                  R
^R7       R# )z4Test for handling suptitle and for sharex and shareyr6   Fr8   sharexshareyr   r   r   rM   r   rN   zTest SuptitleN)	r9   r@   rA   r2   r   r   
set_aspectrI   suptitlerQ   s       r   test_constrained_layout9r      s     ||Aq#(8HChhR"-
b
b  MM"LL$sL3LL2L.r   zconstrained_layout10.pngx86_64gMb?)r4   tolc                     \         P                  ! ^^RR7      w  rVP                   F*  pVP                  \        P
                  ! ^4      RR7       K,  	  XP                  RRR7       R# )	z%Test for handling legend outside axisr6   r7   zThis is a label)labelzcenter left)locbbox_to_anchorN)g?      ?)r9   r@   rA   r   r'   arangelegendrB   s      r   test_constrained_layout10r      sO     ||Aq7HChh
		"%67 II-
I;r   zconstrained_layout11.pngc                    \         P                  ! RR	R7      p \        P                  ! ^^V R7      p\        P                  ! ^^V^ ,          4      p\        P                  ! ^^V^,          4      pV P                  V^,          4      p\        V^	R7       . pV F*  pV P                  V4      pWT.,          p\        V^	R7      pK,  	  V P                  XVRRR7       V P                  V^ ,          4      p\        V^	R7       R# )
z"Test for multiple nested gridspecsr6   r8   r~   rY   r   r        Q@r   rO   aspectN)      	r9   r:   r   ry   rz   r;   r   r2   rI   r=   gs0r_   gsl0r   rC   r^   r1   s           r   test_constrained_layout11r      s     **M7
;C


Aq
-C

*
*1aQ
8C++Aq#a&9D	Q	 Ba 
C__R tR!,  LLSL5	Q	 Ba r   zconstrained_layout11rat.pngc                    \         P                  ! RR
R7      p \        P                  ! ^^V ^^.R7      p\        P                  ! ^^V^ ,          4      p\        P                  ! ^^V^,          ^^.R7      pV P                  V^,          4      p\        V^	R7       . pV F*  pV P                  V4      pWT.,          p\        V^	R7      pK,  	  V P                  XVRRR7       V P                  V^ ,          4      p\        V^	R7       R	# )z4Test for multiple nested gridspecs with width_ratiosr6   r   )r:   width_ratios)height_ratiosr   r   r   r   N)r   r   r   r   s           r   test_constrained_layout11ratr      s     **M7
;C


AqAq6
BC

*
*1aQ
8C++Aq#a&AOD	Q	 Ba 
C__R tR!,  LLSL5	Q	 Ba r   zconstrained_layout12.pngc                    \         P                  ! RR	R7      p \        P                  ! ^^V R7      pV P	                  VR
,          4      pV P	                  VR,          4      p\        V^R7       \        V^R7       V P	                  VR,          4      p\        VRR7       V P	                  VR,          4      p\        VRR7       V P	                  VR,          4      p\        VRR7       VP                  R4       R# )z/Test that very unbalanced labeling still works.r6   r   rY   r   T)r   r   N)      ):Nr   Nr   )r   NNr   )r   r   Nr   ):r      Nr   ):r   NNr   )r9   r:   r   ry   r;   r   r   )r=   r   ax1ax2r   s        r   test_constrained_layout12r      s     **M6
:C


Aq
-C
//#e*
%C
//#e*
%Cr"r"	V	%B4 	V	%B4 	U	$B4 MM)r   zconstrained_layout13.pngc            	        \         P                  ! ^^RR7      w  rVP                   F%  p\        V^R7      pV P	                  W2RRRR7       K'  	  \
        P                  ! \        4      ;_uu_ 4        V P                  4       P                  ^^R7       R	R	R	4       V P                  4       P                  RRR
7       R	#   + '       g   i     L3; i)Test that padding works.r6   r7   r   r         4@rF   r   rO   r   rG   )wpadhpadN)w_padh_padUUUUUU?)
r9   r@   rA   r2   rI   rv   raises	TypeErrorget_layout_enginesetrQ   s       r   test_constrained_layout13r     s     ||Aq7HChhR"-SCTB  
y	!	!###3 
"gW= 
"	!s   3"C  C	zconstrained_layout14.pngc            	         \         P                  ! ^^RR7      w  rVP                   F%  p\        V^R7      pV P	                  W2RRRR7       K'  	  V P                  4       P                  RRRRR	7       R
# )r   r6   r7   r   r   r   rF   r   皙?r   r   hspacewspaceNgUUUUUU?)r9   r@   rA   r2   rI   r   r   rQ   s       r   test_constrained_layout14r     sn     ||Aq7HChhR"-SCTB  s   $r   zconstrained_layout15.pngc                     R\         P                  R&   \        P                  ! ^^4      w  rVP                   F  p\        V^R7       K  	  R# )zTest that rcparams work.Tzfigure.constrained_layout.user   N)mplrcParamsr9   r@   rA   r   rB   s      r   test_constrained_layout15r   *  s=     59CLL01||Aq!HChhR"% r   zconstrained_layout16.pngc                 x    \         P                  ! RR7      w  r\        V^R7       V P                  . RO4      pR# )zTest ax.set_position.r6   r7   r   N)r   r   皙?r   )r9   r@   r   add_axesr=   r   r   s      r   test_constrained_layout16r   3  s-     ll-0GCb!
,,+
,Cr   zconstrained_layout17.pngc                 ~   \         P                  ! RR7      p \        P                  ! ^^V R7      pV P	                  VR,          4      pV P	                  VR,          4      pV P	                  VR,          4      pV P	                  VR,          4      p\        V4       \        V4       \        V4       \        V4       R# )	zTest uneven gridspecsr6   r7   rY   Nr   r   )r   r   NN)r   r   )r   r&   )r9   r:   r   ry   r;   r   )r=   r^   r   r   ax3ax4s         r   test_constrained_layout17r   ;  s     **M
*C			1a	,B
//"T(
#C
//"U)
$C
//"W+
&C
//"V*
%Cr   c                 4   \         P                  ! RR7      w  rVP                  4       p\        V4       \        V^R7       V P	                  4        \        VP                  4       P                  VP                  4       P                  8H  4      '       g   Q hR# )z
Test twinxr6   r7   r   N)r9   r@   twinxr   rh   allri   extentsr   s      r   test_constrained_layout18r   L  sm    ll-0GC
((*Cr" r ((C,<,<,>,F,FFGGGGr   c                 x   \         P                  ! RR7      w  rVP                  4       p\        V4       \        V^R7       VP	                  R4       VP	                  R4       V P                  4        \        VP                  4       P                  VP                  4       P                  8H  4      '       g   Q hR# )z
Test twinyr6   r7   r   r   N)	r9   r@   twinyr   r   rh   r   ri   r   r   s      r   test_constrained_layout19r   V  s    ll-0GC
((*Cr"MM"LL r ((C,<,<,>,F,FFGGGGr   c                     \         P                  ! R^^4      p \         P                  ! W R,          4      p\        P                  ! 4       pVP                  . RO4      pVP                  W VRR1RR13,          4      pVP                  V4       R# )z)Smoke test cl does not mess up added AxesN)r   N)r   r   r   r   r&   )r'   linspacehypotr9   r:   r   r+   rI   )gximgr=   r   meshs        r   test_constrained_layout20r   b  sk    	RA	B
((2'{
#C
**,C	l	#B==SbS#2#X/DLLr   c                    \         P                  ! RR7      w  rV P                  R4       V P                  4        \        P
                  ! VP                  4       P                  4      pV P                  R4       V P                  4        \        P
                  ! VP                  4       P                  4      p\        P                  P                  W#4       R# )z>#11035: repeated calls to suptitle should not alter the layoutr6   r7   	Suptitle0	Suptitle1N)
r9   r@   r   rh   r'   copyri   r   testingassert_allcloser=   r   extents0extents1s       r   test_constrained_layout21r   m  s    ll-0GCLL wwr(001HLL wwr(001HJJx2r   c                    \         P                  ! RR7      w  rV P                  4        \        P                  ! VP                  4       P                  4      pV P                  RRR7       V P                  4        \        P                  ! VP                  4       P                  4      p\        P                  P                  W#4       R# )zC#11035: suptitle should not be include in CL if manually positionedr6   r7   Suptitler   r.   N)
r9   r@   rh   r'   r   ri   r   r   r   r   r   s       r   test_constrained_layout22r   |  s    ll-0GC wwr(001HLLsL# wwr(001HJJx2r   c                     \        ^4       F[  p \        P                  ! RRRR7      pVP                  ^^4      pV^ ,          P	                  ^^4      pVP                  RV  24       K]  	  R# )zi
Comment in #11035: suptitle used to cause an exception when
reusing a figure w/ CL with ``clear=True``.
r6   T123)r8   clearnumr   N)rg   r9   r:   r[   r\   r   )rq   r=   r^   subs       r   test_constrained_layout23r     s^     1XjjTuEa#e1%xs^$	 r   ztest_colorbar_location.pngT)remove_textr4   c                 (   R\         P                  R&   \         P                  ! ^^RR7      w  rVP                   F0  p\	        V4      pVP                  R4       VP                  R4       K2  	  V P                  XVR,          RR7       V P                  W1R,          RR	R
7       V P                  W1R,          RR	RR7       V P                  W1R,          RRR
7       V P                  W1R,          RRR
7       V P                  W1R,          RRR
7       R# )zM
Test that colorbar handling is as expected for various complicated
cases...
Fzpcolormesh.snapr6   r7   r   r   )r   rO   r   rT   )r   rO   rV   g?)r   rO   rV   rG   topleftrightNr   r   )r&   :Nr   N)r   :r   NN)r   r   ):r   r   Nr   )r9   r   r@   rA   r2   r   r   rI   rQ   s       r   test_colorbar_locationr     s     ',CLL"#||Aq7HChhR 
b
b  LLT3L/LLVS8LDLLUC(LMLLVS5LALLT3L@LLVS7LCr   c                  >   \         P                  ! ^^RR7      w  rVR,          P                  R4       V P                  4        \        P
                  ! VR,          P                  4       P                  4      p\        P                  P                  V. R	ORR7       R# )
r   r6   r7   Fh㈵>)rtolNr   r   )g/ע?g<Q?gd:tzލ?g`?)
r9   r@   set_visiblerh   r'   r   ri   r   r   r   )r=   rC   r   s      r   test_hidden_axesr    sw     ||Aq7HCI%  wws4y--/778HJJ:  Gr   c            
      4   R EF  p \         P                  ! ^^RR7      w  r. p\        VP                  4       F  w  rEVP	                  RR7       \        V4      pVP                  WeV RRR7      pW7.,          pVP                  P	                  RR7       V^8w  g   Ke  VP                  P                  P                  . 4       VP                  P                  P                  . 4       VP                  . 4       VP                  . 4       K  	  VP                  4       P                  RRRRR	7       VP                  4        V R9   d   \         P"                  P%                  V^ ,          P                  P'                  4       P(                  V^,          P                  P'                  4       P(                  4       \         P"                  P%                  V^,          P                  P'                  4       P(                  V^,          P                  P'                  4       P(                  4       EK,  \         P"                  P%                  V^ ,          P                  P'                  4       P*                  V^,          P                  P'                  4       P*                  4       \         P"                  P%                  V^,          P                  P'                  4       P*                  V^,          P                  P'                  4       P*                  4       EK  	  R
# )r   r6   r7   in)	directionr   g{Gz?)r   rV   rO   rG   g?r   N)r   r   r   rT   gqq?)r   r   )r9   r@   rH   rA   tick_paramsr2   rI   r   xaxis	set_ticksyaxisr   r   r   r   rh   r'   r   r   ri   x0rj   )rV   r=   rC   cbsrJ   r   pccbs           r   test_colorbar_alignr    s3   6<<1];)FBNNTN*#Bb(3"&  (B4KCEE-Qw%%b)%%b)""2&""2& * 	##&+.s 	$ 	< 	""$((JJ&&s1vyy'='='?'B'B'*1vyy'='='?'B'BDJJ&&s1vyy'='='?'B'B'*1vyy'='='?'B'BD JJ&&s1vyy'='='?'B'B'*1vyy'='='?'B'BDJJ&&s1vyy'='='?'B'B'*1vyy'='='?'B'BD7 7r   ztest_colorbars_no_overlapV.pngc                  j   \         P                  ! RRR7      p V P                  ^^RRR7      pV Fn  pVP                  P	                  \
        P                  ! 4       4       VP                  RRR7       VP                  ^^.^^..4      pV P                  W2RR	7       Kp  	  V P                  R
4       R# )r   r6   r}   Tr   r   bothr  axisr  verticalr   orientationfooN)r   r   )r9   r:   r@   r  set_major_formatterr   NullFormatterr	  imshowrI   r   r=   rC   r   ims       r   test_colorbars_no_overlapVr     s    
**VM
:C
,,q!D,
6C
$$V%9%9%;<
Fd3YYAA'(RJ7	 
 LLr   ztest_colorbars_no_overlapH.pngc                  j   \         P                  ! RRR7      p V P                  R4       V P                  ^^RRR7      pV Fn  pVP                  P                  \        P                  ! 4       4       VP                  RRR7       VP                  ^^.^^..4      pV P                  W2R	R
7       Kp  	  R# )r   r6   r}   r  Tr  r  r  r  
horizontalr  N)r   r   )r9   r:   r   r@   r  r  r   r  r	  r  rI   r  s       r   test_colorbars_no_overlapHr#    s    
**VM
:CLL
,,q!D,
6C
$$V%9%9%;<
Fd3YYAA'(RL9	 r   c                     \         P                  ! ^^RR7      w  rV^ ,          P                  . RO4       V P                  4        V^ ,          P	                  4       p\
        P                  P                  VRR.RR..4       \         P                  ! ^^RR7      w  rV^ ,          P                  . RO4       V^ ,          P                  \
        P                  P                  ^^4      4      pV P                  W1^ ,          R7       V P                  4        V^ ,          P	                  4       p\
        P                  P                  VRR.RR..4       R# )	r   r6   r7   r   r   r   g)\(?Nr   r   333333?r'  )r9   r@   set_positionrh   ri   r'   r   r   r+   randomrandrI   )r=   rC   ppr  s       r   test_manually_set_positionr,    s   ||Aq7HCF,- 	Q			BJJrS#Jc
#;<||Aq7HCF,-	Q		299>>"b1	2BLLAL 	Q			BJJrS#Js#<=r   ztest_bboxtight.pngbbox_inchestight)r   r4   savefig_kwargc                  Z    \         P                  ! R R7      w  rVP                  R4       R# r6   r7   r    Nr9   r@   r   r<   s     r   test_bboxtightr3    s      ll-0GCMM"r   ztest_bbox.pngr   g      @c                  Z    \         P                  ! R R7      w  rVP                  R4       R# r1  r2  r<   s     r   	test_bboxr5    s     
 ll-0GCMM"r   c                     \         P                  ! ^^RR
RR/R7      w  p w  rpVP                  ^ ^4       VP                  R4       VP                  RR4       VP                  R4       VP                  ^ ^4       VP                  R4       V P	                  WV3R7       V P                  4        VP                  P                  P                  4       VP                  P                  P                  4       VP                  P                  P                  4       .p\        P                  P                  V^ ,          P                  V^,          P                  .V^,          P                  ^ RR7       V^ ,          P                  ^8  g   Q hR	# )z
Tests for a bug in which constrained layout and align_ylabels on
three unevenly sized subplots, one of whose y tick labels include
negative numbers, drives the non-negative subplots' y labels off
the edge of the plot
r6   r   )r8   r~   gridspec_kwLabelg      ?)rC   r  )r  atolN)g@r   )r   r   gffffff?g      )r9   r@   set_ylimr   align_ylabelsrh   r  r   get_window_extentr'   r   r   r  )r=   r   r   r   after_aligns        r   test_align_labelsr>    sI    <<1]085D GL 5MNC#C
 LLANN7LLsNN7LLANN73S/* 99??44699??44699??4468K JJA 1 1;q>3D3DE*1~00qu  F q>!!!r   c                     \         P                  ! R R7      w  rV P                  4        VP                  V P                  P                  4       4      pV P                  R4       V P                  R4       V P                  4        VP                  V P                  P                  4       4      pVP                  VP                  R,           8  g   Q hVP                  VP                  R,           8  g   Q h\         P                  ! R R7      w  rV P                  4        VP                  V P                  P                  4       4      pV P                  RRR7       V P                  RRR7       V P                  4        VP                  V P                  P                  4       4      pVP                  VP                  R,           8  g   Q hVP                  VP                  R,           8  g   Q hR# )	r6   r7   BooBooyg      $@r   )r/   r   N)
r9   r@   rh   get_tightbboxcanvasget_renderer	supxlabel	supylabelrj   r  )r=   r   pos0poss       r   test_suplabelsrI  6  sf   ll-0GC CJJ3356DMM%MM& 


3::224
5C66DGGdN"""66DGGdN"""ll-0GC CJJ3356DMM%3MMM%3M 


3::224
5C66DGGdN"""66DGGdN"""r   c                      \         P                  ! 4       p V P                  ^^4      pV P                  VR,          4      pV P	                  4        R# )r   N):r   NNr   )r9   r:   r[   r;   rh   )r=   r^   sps      r   test_gridspec_addressingrL  M  s=    
**,C			!Q	B	F	$B r   c                  B   \         P                  ! R R7      w  rV P                  4        \        P                  ! \
        RR7      ;_uu_ 4        \         P                  ! 4       w  rV P                  R 4       V P                  4        RRR4       \        P                  ! \
        RR7      ;_uu_ 4        \         P                  ! 4       w  rV P                  RRRR/4       V P                  4        RRR4       R#   + '       g   i     L{; i  + '       g   i     R# ; i)Tre   zwill be deprecatedrt   Nr   rF   r   )r9   r@   rh   rv   rw   PendingDeprecationWarningset_constrained_layoutr<   s     r   test_discouraged_apirP  T  s    lld3GC 	/0
2 
2,,.""4(""$	
2 
/0
2 
2,,.""GT7D#AB""$	
2 
2
2 
2
2 
2 
2s   9C:3=D:D
	D	c                  \    \         P                  ! R R/R7      w  rV P                  4        R# )r   rF   re   N)r9   r@   rh   r<   s     r   test_kwargsrR  e  s"    llwo>GC r   c                  V   \         P                  ! R R7      w  rV P                  4       P                  . ROR7       V P	                  4        VP                  4       pVP                  R8  g   Q hVP                  R8  g   Q h\         P                  ! R R7      w  rV P                  4       P                  . ROR7       V P	                  4        VP                  4       pVP                  R8  g   Q hVP                  R8  g   Q hVP                  R8  g   Q hVP                  R8  g   Q hR# )r6   r7   r   )rectr   N)r   r   r   r   r&  )
r9   r@   r   r   rh   ri   x1rk   r  rj   )r=   r   pposs      r   	test_rectrW  j  s    ll-0GC%56 ??D77S==77S==ll-0GC%9: ??D77S==77S==77S==77S==r   c            	         \         P                  ! ^^RRRR7      w  rVP                   F2  pVP                  \        P
                  P                  ^^4      4      pK4  	  V P                  XVR7       V P                  4        VR,          P                  4       p\        P                  P                  VP                  RRR7       VR,          P                  4       p\        P                  P                  VP                  RR	R7       \         P                  ! ^^RRRRR
7      w  rVP                   F2  pVP                  \        P
                  P                  ^^4      4      pK4  	  V P                  W1R7       V P                  4        VR,          P                  4       p\        P                  P                  VP                  RR	R7       \        P                  P                  VP                  RRR7       VR,          P                  4       p\        P                  P                  VP                  RR	R7       \        P                  P                  VP                  RRR7       R# )r   
compressedTr   r%  gz?rM   r9  gz?MbP?)r8   r   r   r~   gZ|
?g+ݓ?g\C?gMSt$?Nr   r   )r   r   )r   r   )r9   r@   rA   r  r'   r)  randnrI   rh   ri   r   r   r  rU  rk   rj   )r=   rC   r   r  rH  s        r   test_compressed1r]  |  s   ||Aq#'6HChhYYryyr2./  LLL 
d)
 
 
"CJJsvvvD9
d)
 
 
"CJJsvvvD9 ||Aq#'fFHChhYYryyr2./  LLL 
d)
 
 
"CJJsvvwT:JJsvvvD9
d)
 
 
"CJJsvvvD9JJsvvvD9r   c            	         \         P                  ! ^RRRRR^ /R7      w  p w  rVP                  R4       VP                  R4       VP                  R4       VP                  ^4       V P	                  R4      pV P                  4        VP                  4       ^,          \        P                  ! RRR	7      8X  g   Q hV P	                  RR
R7      pV P                  4        VP                  4       ^,          R
8X  g   Q hV P	                  RRR7      pV P                  4        VP                  4       ^,          R
8X  g   Q hR# )r   rY  r   r   )nrowsr~   r8   r7  equalr   g-?r[  )absg\(\?r   F)	in_layoutN)r   r   )g      ?g      ?r   )	r9   r@   r  set_box_aspectr   rh   ri   rv   approx)r=   ax0r   titles       r   test_compressed_suptitlerg    s   ll$nhBDOC# HHWsHHWqLL!E "fmmF&EEEELLDL)E "d***LLEL2E "d***r   z
arg, staterT  c                 d    \         P                  ! V R 7      w  r#VP                  4       VJ g   Q hR# )re   N)r9   r@   get_constrained_layout)argstater=   r   s   &&  r   test_set_constrained_layoutrl    s+     llc2GC%%'5000r   c                     \         P                  ! 4       w  r\        P                  ! \        4      ;_uu_ 4        V P                  R 4       V P                  4       '       g   Q hV P                  R4       V P                  4       '       d   Q hV P                  R 4       V P                  4       '       g   Q h RRR4       R#   + '       g   i     R# ; i)TFN)r9   r@   rv   rw   rN  rO  ri  r<   s     r   test_constrained_togglern    s    llnGC	/	0	0""4())++++""5)--////""4())++++ 
1	0	0	0s   AC(C4CC	c                     \         P                  ! R RR7      p V P                  4        V P                  4        \         P                  ! R4       ? \
        P                  ! 4        \        ;QJ d/    R \
        P                  ! 4        4       F  '       g   K   R M$	  RM ! R \
        P                  ! 4        4       4      '       d   Q hR# )T)rf   r~   r   c              3   j   "   T F)  p\        V\        P                  P                  4      x  K+  	  R # 5i)N)
isinstancer   _layoutgrid
LayoutGrid).0objs   & r   	<genexpr>#test_layout_leak.<locals>.<genexpr>  s+      0.s c3??#=#=>>.s   13FN)r   r   )	r9   r:   r;   rh   closegccollectanyget_objects)r=   s    r   test_layout_leakr}    s     **h
?COO IIeJJLs 0 nn.0sss 0 nn.0 0 0 0 0 0r   c                    \         P                  ! RRR7      p V P                  ^^4      p. pVP                  4        F  pVP	                  ^^4      p\        ^4       F:  pW#P                  WE^ 3,          4      .,          pVR,          P                  4        K<  	  VP                  VR	,          4      P                  4        K  	  V P                  4        VR,           Fi  p\        P                  ! VP                  4       P                  R,          V^ ,          P                  4       P                  R,          RR7      '       d   Ki  Q h	  R# )
zv
Test that the submerged margin logic does not get called multiple times
on same axes if it is already in a subfigure
r6   r}   r   gư>rZ  N)r   r   r&   r   )r9   r:   
subfiguresflattenr[   rg   r;   r   rh   r'   allcloseri   bounds)r=   figuresrC   fr^   rq   r   s          r   test_submerged_subfigr    s   
 **VM
:CnnQ"G
C__^^Aq!qAMM"T(+,,CGLLN  	
bh$$&   "gg{{2??,33B7q6..077;$H H 	H H r   )   F)r  )TT)FF)Fry  platformnumpyr'   rv   
matplotlibr   matplotlib.testing.decoratorsr   matplotlib.pyplotpyplotr9   matplotlib.transforms
transformsmtransformsr   r   markusefixtures
pytestmarkr   r2   r>   rD   rK   rR   rW   rc   rr   r{   r   r   machiner   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r#  r,  r3  Bboxr5  r>  rI  rL  rP  rR  rW  r]  rg  parametrizerl  rn  r}  r   r   r   <module>r     s   	     :  + ' KK/0

	
 ,-W=" >" ,-W=& >& ,-W=
* >
* ,-W=4 >4 ,-W=$ >$ ,-W=4 >4.?(%  ,-W=4 >46 ,-W=/ >/ -.g#++-9auF<F< -.g>! ?!& 01A! B!& -.g> ?* -.g>> ?> -.g>$ ?$ -.g>& ?& -.g>- ?- -.g> ? H	H33
% /0"'3D3D*
GD@ 34GD E 34GD: E:>  '("'!. 8::
 ?#"'!.!,!1!1C8c1X2F!G!IJ	J
"D#.!%"!
$:>+0 Jd^T	( 11
,
0Hr   