+
     ]i^  c                   s   ^ 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tickerZtext_placeholdersc                 s   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# )   Znbinsx-labelfontsizey-labelTitleN)plotZlocator_params
set_xlabel
set_ylabel	set_titleset_xticklabelsset_yticklabels)axr   nodecs   &&&N/usr/lib64/python3.14/site-packages/matplotlib/tests/test_constrainedlayout.pyexample_plotr      sq    GGQFOA
i(3
i(3
Wx0
2
2    c           
      s   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?       @NZRdBu_r      ?T)ZcmapZvminZvmaxZ
rasterizedr   r   r	   r
   ig      )npZmgridZsliceZexp
pcolormeshr   r   r   )r   r   ZdxZdyyxZzpcms   &&      r   example_pcolorr      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.pngZmpl20)stylec                 sn    \         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        r   test_constrained_layout1r*   ,   s(     **M
*C		Bb!r   zconstrained_layout2.pngc                 s|    \         P                  ! ^^RR7      w  rVP                   F  p\        V^R7       K  	  R# )z(Test constrained_layout for 2x2 subplotsr!   r"   r   N)r$   subplotsflatr   r(   axsr         r   test_constrained_layout2r0   4   s0     ||Aq7HChhR"% r   zconstrained_layout3.pngc                 s    \         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 subplotsr!   r"   r   g{Gz?{Gz?)r   padN)r$   r+   	enumerater,   r   colorbar)r(   r.   nnr   r   r2            r   test_constrained_layout3r7   <   sZ     ||Aq7HCCHH%R"-7CCSS) &r   zconstrained_layout4.pngc                 s    \         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 subplotsr!   r"   r   {Gz?r   r   r2   shrinkNr$   r+   r,   r   r4   r(   r.   r   r          r   test_constrained_layout4r>   J   sF     ||Aq7HChhR"- LL$sL3r   zconstrained_layout5.pngc            	     s    \         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
r!   r"   r   Fr8   r   bottom)r   Zuse_gridspecr2   r:   locationNr;   r<   r=   r   test_constrained_layout5rA   T   sQ     ||Aq7HChhR"- LL#c"  $r   zconstrained_layout6.pngc                 s   \         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 gridspecsr!   r"   r%   r   zx-label
MultiLiner8   gGz?r?   r   )r   r2   r:   r@   ZticksN)r$   r%   add_gridspecsubgridspecr&   r   r   r   r4   r   ZMaxNLocator)r(   gsgslgsrZaxslr   Zaxsrr              r   test_constrained_layout6rI   c   s     **M
*C			!Qs		+B
Q%

Aq
!C
Q%

Aq
!CD__R R"%  MM&'D__R R"- 
 LL$))2  4r   c                  s   \         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        R# )Tconstrained_layoutN)r$   r%   rC   rD   ranger&   draw_without_rendering)r(   ZGSZGSAZGSBZaxaZaxbi          r   test_identical_subgridspecrP   {   s    
**
-C			!Q	B
Q%

Aq
!C
Q%

Aq
!C
C
C1X'(('((   r   c                 s   \         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Zmatchr!   r"   N)
pytestwarnsZUserWarningr$   r%   r   GridSpecGridSpecFromSubplotSpecr&   rM   )r(   rE   rF   rG   r=   r   test_constrained_layout7rV      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                 s   \         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 fullr!   figsizer#   rB   r    r8   r   r9   N)
      r    r   )   NNN)
r$   r%   r   rT   r&   r   r   r   r   r4   )r(   rE   r.   ZjZilistrN   r   r   rH   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                 s6   \         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 shareyr!   Fr#   sharexshareyr   rY   r   r8   r   r9   zTest SuptitleN)	r$   r+   r,   r   r   r   
set_aspectr4   suptitler<   r=   r   test_constrained_layout9re      s     ||Aq#(8HChhR"-
b
b  MM"LL$sL3LL2L.r   zconstrained_layout10.pngZx86_64gMb?)r    Ztolc                 s    \         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 axisr!   r"   zThis is a label)labelzcenter left)ZlocZbbox_to_anchorN)g?      ?)r$   r+   r,   r   r   ZarangeZlegendr-   r/   r   test_constrained_layout10rh      sO     ||Aq7HChh
		"%67 II-
I;r   zconstrained_layout11.pngc                 s   \         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 gridspecsr!   r#   rX   rB   r   r        Q@r   r:   aspectN)i      	r$   r%   r   rT   rU   r&   r   r   r4   r(   gs0rF   Zgsl0r   r.   rE   r   rH   r   test_constrained_layout11rq      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                 s   \         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_ratiosr!   ri   )r%   Zwidth_ratios)height_ratiosr   r   rj   rk   N)rZ   rm   rn   ro   rH   r   test_constrained_layout11ratrs      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                 s   \         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.r!   ri   rB   r   T)r   r   N)i      ):Nrm   Nr   )rm   NNr   )r    r]   Nr    ):r]      Nr    ):rw   NNr    )r$   r%   r   rT   r&   r   r   )r(   rp   ax1ax2r           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            	     s   \         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.r!   r"   r   r         4@r1   r   r:   rl   r2   )ZwpadZhpadN)w_padh_padUUUUUU?)
r$   r+   r,   r   r4   rR   ZraisesZ	TypeErrorget_layout_enginesetr<   r=   r   test_constrained_layout13r     s     ||Aq7HChhR"-SCTB  
y	!	!###3 
"gW= 
"	!s   3"C  C	zconstrained_layout14.pngc            	     s    \         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|   r!   r"   r   r   r}   r1   r~   皙?r   r   hspaceZwspaceNgUUUUUU?)r$   r+   r,   r   r4   r   r   r<   r=   r   test_constrained_layout14r     sn     ||Aq7HChhR"-SCTB  s   $r   zconstrained_layout15.pngc                 s    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rcParamsr$   r+   r,   r   r-   r/   r   test_constrained_layout15r   *  s=     59CLL01||Aq!HChhR"% r   zconstrained_layout16.pngc                 sx    \         P                  ! RR7      w  r\        V^R7       V P                  . RO4      pR# )zTest ax.set_position.r!   r"   r   N)r   r   皙?r   )r$   r+   r   add_axesr(   r   ry   r/   r   test_constrained_layout16r   3  s-     ll-0GCb!
,,+
,Cr   zconstrained_layout17.pngc                 s~   \         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 gridspecsr!   r"   rB   Nr    r    )r    r   NN)r   rv   )r   r   )r$   r%   r   rT   r&   r   )r(   rE   rx   ry   ax3Zax4r6   r   test_constrained_layout17r   ;  s     **M
*C			1a	,B
//"T(
#C
//"U)
$C
//"W+
&C
//"V*
%Cr   c                 s    \         P                  ! RR7      w  rVP                  4       p\        V4       \        V^R7       V P	                  4        R# )z
Test twinxr!   r"   r   N)r$   r+   Ztwinxr   rM   r   r/   r   test_constrained_layout18r   L  s;    ll-0GC
((*Cr" r   c                 s    \         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        R# )z
Test twinyr!   r"   r   rY   N)r$   r+   Ztwinyr   r   rM   r   r/   r   test_constrained_layout19r   V  sS    ll-0GC
((*Cr"MM"LL r   c                 s    \         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 AxesNi)r^   N)r    r    r   r   r   )r   ZlinspaceZhypotr$   r%   r   r   r4   )ZgxZimgr(   r   Zmeshrz   r   test_constrained_layout20r   b  sk    	RA	B
((2'{
#C
**,C	l	#B==SbS#2#X/DLLr   c                 s   \         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 layoutr!   r"   Z	Suptitle0Z	Suptitle1N)
r$   r+   rd   rM   r   copyget_positionextentstestingassert_allcloser(   r   Zextents0extents1r=   r   test_constrained_layout21r   m  s    ll-0GCLL wwr(001HLL wwr(001HJJx2r   c                 s   \         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 positionedr!   r"   Suptitlerg   r   N)
r$   r+   rM   r   r   r   r   rd   r   r   r   r=   r   test_constrained_layout22r   |  s    ll-0GC wwr(001HLLsL# wwr(001HJJx2r   c                 s    \        ^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``.
r!   TZ123)r#   ZclearZnumr   N)rL   r$   r%   rC   rD   rd   )rN   r(   rE   Zsubr=   r   test_constrained_layout23r     s^     1XjjTuEa#e1%xs^$	 r   ztest_colorbar_location.pngT)remove_textr    c                 s(   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.snapr!   r"   rY   r   )r   r:   rg   r?   )r   r:   r@   g?)r   r:   r@   r2   topleftrightNr^   r   )r   :Nr]   N)r    :r]   NN)iru   r   ):r   rm   Nr]   )r$   r   r+   r,   r   r   r   r4   r<   r=   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                  s>   \         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]   r!   r"   Fh㈵>)rtolNr\   r   )g/ע?g<Q?gd:tzލ?g`?)
r$   r+   Zset_visiblerM   r   r   r   r   r   r   )r(   r.   r   r/   r   test_hidden_axesr     sw     ||Aq7HCI%  wws4y--/778HJJ:  Gr   c            
      s4   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   r!   r"   in)	directionr   g{Gz?)r   r@   r:   r2   g?r   N)r   r   r   r?   gqq?)r   r   )r$   r+   r3   r,   tick_paramsr   r4   r   ZxaxisZ	set_ticksyaxisr   r   r   r   rM   r   r   r   r   x0y0)r@   r(   r.   Zcbsr5   r   pcZcbrH   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                  sj   \         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]   r!   rW   Tra   rb   bothr   axisr   Zverticalr   ZorientationfooN)r]   rw   )r$   r%   r+   r   set_major_formatterr   NullFormatterr   imshowr4   rd   r(   r.   r   Zimr=   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                  sj   \         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# )rw   r!   rW   r   Tr   r   r   r   Z
horizontalr   N)rw   r]   )r$   r%   rd   r+   r   r   r   r   r   r   r4   r   r=   r   test_colorbars_no_overlapHr     s    
**VM
:CLL
,,q!D,
6C
$$V%9%9%;<
Fd3YYAA'(RL9	 r   c                  s   \         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   r!   r"   r   rg   r   g)\(?Nr   r   333333?r   )r$   r+   Zset_positionrM   r   r   r   r   r   randomZrandr4   )r(   r.   Zppr   r=   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.pngZbbox_inchesZtight)r   r    Zsavefig_kwargc                  Z    \         P                  ! R R7      w  rVP                  R4       R# r!   r"   r   Nr$   r+   rc   r'   r)   r   test_bboxtightr     s      ll-0GCMM"r   ztest_bbox.pngrg   g      @c                  r   r   r   r'   r)   r   	test_bboxr     s     
 ll-0GCMM"r   c                 s   \         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       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
r!   rr   )r#   rX   gridspec_kwZLabelg      ?)r.   r   )r   atolN)g@rt   )r   r   gffffff?g      )r$   r+   Zset_ylimr   Zalign_ylabelsrM   r   rf   Zget_window_extentr   r   r   r   )r(   r   rx   ry   Zafter_alignrz   r   test_align_labelsr     s/    <<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r   c                  s   \         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\         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R# )r!   r"   ZBooZBooyrg   )r   r   N)r$   r+   rM   Zget_tightbboxZcanvasZget_rendererZ	supxlabelZ	supylabel)r(   r   Zpos0posr=   r   test_suplabelsr   6  s    ll-0GC CJJ3356DMM%MM& 


3::224
5C ll-0GC CJJ3356DMM%3MMM%3M 


3::224
5Cr   c                  s    \         P                  ! 4       p V P                  ^^4      pV P                  VR,          4      pV P	                  4        R# )rm   N):r    NNr   )r$   r%   rC   r&   rM   )r(   rE   Zspr/   r   test_gridspec_addressingr   M  s=    
**,C			!Q	B	F	$B r   c                  sB   \         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)TrJ   zwill be deprecatedrQ   Nr   r1   r   )r$   r+   rM   rR   rS   PendingDeprecationWarningset_constrained_layoutr'   r)   r   test_discouraged_apir   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                  s\    \         P                  ! R R/R7      w  rV P                  4        R# )r   r1   rJ   N)r$   r+   rM   r'   r)   r   test_kwargsr   e  s"    llwo>GC r   c                  sr   \         P                  ! R R7      w  rV P                  4       P                  . ROR7       V P	                  4        VP                  4       p\         P                  ! R R7      w  rV P                  4       P                  . ROR7       V P	                  4        VP                  4       pR# )r!   r"   )rectN)r    r    rg   rg   r   )r$   r+   r   r   rM   r   )r(   r   Zpposr/   r   	test_rectr   j  s    ll-0GC%56 ??D ll-0GC%9: ??Dr   c            	      s   \         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# )rm   
compressedTr`   r   gz?r8   )r   gz?gMbP?)r#   ra   rb   rX   gZ|
?g+ݓ?g\C?gMSt$?Nr   r\   )r[   rw   )r   r]   )r$   r+   r,   r   r   r   Zrandnr4   rM   r   r   r   r   Zx1Zy1r   )r(   r.   r   r   r   rz   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            	      s   \         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	                  RRR7      pV P                  4        V P	                  RR	R
7      pV P                  4        R# )r]   r   rr   r   )ZnrowsrX   r#   r   Zequalr
   g\(\?r   F)Z	in_layoutN)rw   rZ   )g      ?g      ?r   )r$   r+   r   Zset_box_aspectrd   rM   )r(   Zax0rx   Ztitler=   r   test_compressed_suptitler     s    ll$nhBDOC# HHWsHHWqLL!E  LLDL)E  LLEL2E r   z
arg, stater   c                 s8    \         P                  ! V R 7      w  r#R# )rJ   N)r$   r+   )ZargZstater(   r   s   &&  r   test_set_constrained_layoutr     s     llc2GCr   c                  s   \         P                  ! 4       w  r\        P                  ! \        4      ;_uu_ 4        V P                  R 4       V P                  R4       V P                  R 4       RRR4       R#   + '       g   i     R# ; i)TFN)r$   r+   rR   rS   r   r   r'   r)   r   test_constrained_toggler     sX    llnGC	/	0	0""4(""5)""4( 
1	0	0	0s   4A88B		c                  s    \         P                  ! R RR7      p V P                  4        V P                  4        \         P                  ! R4       ? \
        P                  ! 4        R# )T)rK   rX   ZallN)rZ   rZ   )r$   r%   r&   rM   ZclosegcZcollect)r(   s    r   test_layout_leakr     sB     **h
?COO IIeJJLr   c                 s   \         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,           F  pK  	  R# )zv
Test that the submerged margin logic does not get called multiple times
on same axes if it is already in a subfigure
r!   rW   r   N)rw   r[   r   r   )	r$   r%   Z
subfiguresZflattenrC   rL   r&   r   rM   )r(   Zfiguresr.   ZfrE   rN   r   rO   r   test_submerged_subfigr     s    
 **VM
:CnnQ"G
C__^^Aq!qAMM"T(+,,CGLLN  	
bh$$&   "gggr   )   F)r   )TT)FF)Fr   ZplatformZnumpyr   rR   Z
matplotlibr   Zmatplotlib.testing.decoratorsr   Zmatplotlib.pyplotZpyplotr$   Zmatplotlib.transformsZ
transformsZmtransformsr   r   ZmarkZusefixturesZ
pytestmarkr   r   r*   r0   r7   r>   rA   rI   rP   rV   r_   re   Zmachinerh   rq   rs   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZBboxr   r   r   r   r   r   r   r   r   Zparametrizer   r   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   