+
     ]i
  c                   s2    R t ^ RIHtHtHt RR ltRR ltR# )zE
Helper module for the *bbox_inches* parameter in `.Figure.savefig`.
)BboxTransformedBboxAffine2DNc                s  a aaaaaa S P                   oS P                  oS P                  P                  o. o. o\	        4       oS P
                   F  pVP                  4       pVe   VP                  V! VR4      4       SP                  V4       VP                  RR7      P                  4       pVP                  V3R l4       RVP                  9   d   SP                  VP                  4       MSP                  S4       RR lVn        K  	  VV VVVVV3R lpVf   S P                  p\        4       P                  V4      pVS P                  ,          p\         P"                  ! ^ ^ .VP$                  O5!  S n        VP'                  VP(                  4      w  rS P                   P$                  V,          w  r\         P"                  ! V	) V
) W4      S P                  n        S P                  P+                  4        \-        S P                  V4      S n         S P.                  P1                  W,          W,          S P                   P2                  V,          S P                   P4                  V,          4       V# )	a3  
Temporarily adjust the figure so that only the specified area
(bbox_inches) is saved.

It modifies fig.bbox, fig.bbox_inches,
fig.transFigure._boxout, and fig.patch.  While the figure size
changes, the scale of the original figure is conserved.  A
function which restores the original values are returned.
NF)Zoriginalc                 s    V# N )ZarZ_poss   &&&=/usr/lib64/python3.14/site-packages/matplotlib/_tight_bbox.py<lambda>adjust_bbox.<locals>.<lambda>   s    4    apply_aspectc                 s    R # r   r   )Zposs   &r   r   r   %   s    4r	   c                  s:  < \        SP                  SS4       F'  w  rpV P                  V4       VS	J d   V =K!  W n        K)  	  SSn        SSn        SSP                  n        SP                  P                  4        SP                  P                  ^ ^ ^^4       R# )i    N)Zzipaxesset_axes_locatorr
   bboxbbox_inchestransFigure_boxout
invalidatepatch
set_bounds)
axZlocZaspectr   figlocator_list
old_aspectorigBboxorigBboxInchessentinels
      r   restore_bboxZ!adjust_bbox.<locals>.restore_bbox'   s    "388\:FOBV$!O"(  G (")""$		Q1a(r	   r   )r   r   r   r   Zobjectr   Zget_axes_locatorr
   ZappendZget_positionZfrozenr   Z__dict__Zdpir   Zscaler    Zfrom_boundsZsizeZ	transformZp0r   r   r   r   ZwidthZheight)r   r   	fixed_dpir   ZlocatorZcurrent_posr   ZtrZ	dpi_scaleZx0Zy0Zw1Zh1r   r   r   r   r   r   s   f&&          @@@@@@r   adjust_bboxr      s    xxH__Noo%%GJLxHhh%%'OOGB-.G$oouo5<<>
k?@R[[(boo.h'/ ) ) GG				)	$BCGG#I&&q!?k.>.>?CO\\+..)FBXX]]Y&FB"..sRC@COOOO s3CHII"'",chhoo.BD r	   c                s6    Vw  r4V! 4        \        WV4      pW53# )z
A function that needs to be called when figure dpi changes during the
drawing (e.g., rasterizing).  It recovers the bbox and re-adjust it with
the new dpi.
)r   )r   Zbbox_inches_restorer   r   r   r   s   &&&   r   process_figure_for_rasterizingr   I   s%     !4KNCi0A>r	   r   )Z__doc__Zmatplotlib.transformsr    r   r   r   r   r   r	   r   <module>r      s    B A>Br	   