Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/offsetbox.cpython-312.pyc
T

770 lines
73 KiB
Plaintext
Raw Normal View History

Ë
†RjÚÔãóLdZddlZddlZddlZddlmZmZddlm Z
ddl m Z
ddlmZddlmZddlmZddlmZddlmZmZmZddlmZmZmZdZ d „Z!d
Z"d,d Z#d-d Z$Gd
de
jJ«Z&Gdde&«Z'Gdde'«Z(Gdde'«Z)Gdde&«Z*Gdde&«Z+Gdde&«Z,Gdde&«Z-Gdde&«Z.dZ/Gd „d!e.«Z0Gd"„d#e&«Z1Gd$„d%e
jJejd«Z3Gd&„d'«Z4Gd(„d)e4«Z5Gd*„d+e4«Z6y).ac
Container classes for `.Artist`\s.
`OffsetBox`
The base of all container artists defined in this module.
`AnchoredOffsetbox`, `AnchoredText`
Anchor and align an arbitrary `.Artist` or a text relative to the parent
axes or a specific anchor point.
`DrawingArea`
A container with fixed width and height. Children have a fixed position
inside the container and may be clipped.
`HPacker`, `VPacker`
Containers for layouting their children vertically or horizontally.
`PaddedBox`
A container to add a padding around an `.Artist`.
`TextArea`
Contains a single `.Text` instance.
éN)Ú_apiÚ
_docstring)ÚFontProperties)Ú BboxImage)ÚFancyBboxPatchÚFancyArrowPatchÚ bbox_artist)ÚBboxÚBboxBaseÚTransformedBboxFcóRddgŠtj«ˆˆfd«}|S)
Decorator for the get_offset method of OffsetBox and subclasses, that
allows supporting both the new signature (self, bbox, renderer) and the old
signature (self, width, height, xdescent, ydescent, renderer).
cót«S©Úlocals)ÚselfÚwidthÚheightÚxdescentÚydescentÚrenderers úW/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/offsetbox.pyú<lambda>z$_compat_get_offset.<locals>.<lambda>3sÄfÃh€ócót«Srr©rÚbboxrs rrz$_compat_get_offset.<locals>.<lambda>4s¬«rcó¶tj|g|¢­i|¤Ž}d|vr|dn%tj|d |d |d|d«}|d||d«S)Nrrrrrrr)rÚselect_matching_signaturer
Ú from_bounds)rÚargsÚkwargsÚparamsrÚmethÚsigss €€rÚ
get_offsetz&_compat_get_offset.<locals>.get_offset6s}ø€ä×°dÐL¸TÒLÀVÑLˆØ"(¨FÑ"2vÜ× Ñ  Ñ"4Ð!4°v¸jÑ7IÐ6IØ!'¨¡°&¸Ñ2BóDð
ñF˜6N D¨&°Ñ*<Ó=r)Ú functoolsÚwraps)r$r&r%s` @rÚ_compat_get_offsetr)-s8ù€ñ
OÙ  3€Dô‡__ôð Ðrcó(tr t|i|¤Žyyr)ÚDEBUGÚ mbbox_artist)r!r"s rÚ _bbox_artistr-AsÝ Ü%˜fÓ
rcóvtjgd¢|¬«|dk(r=tjdg|Dcgc]}||zŒ c}z«}|dd}||d|z
}||fS|dk(re|d}t |«dkDr|t |«z
t |«dz
z }nd}tjdg|Dcgc]}||zŒ c}z«}|dd}||fS|d k(ret
|«}|| td
«||zt |«z}n|t |«z |z
}||ztjt |««z}||fSycc}wcc}w) a[
Pack boxes specified by their *widths*.
For simplicity of the description, the terminology used here assumes a
horizontal layout, but the function works equally for a vertical layout.
There are three packing *mode*\s:
- 'fixed': The elements are packed tight to the left with a spacing of
*sep* in between. If *total* is *None* the returned total will be the
right edge of the last box. A non-*None* total will be passed unchecked
to the output. In particular this means that right edge of the last
box may be further to the right than the returned total.
- 'expand': Distribute the boxes with equal spacing so that the left edge
of the first box is at 0, and the right edge of the last box is at
*total*. The parameter *sep* is ignored in this mode. A total of *None*
is accepted and considered equal to 1. The total is returned unchanged
(except for the conversion *None* to 1). If the total is smaller than
the sum of the widths, the laid out boxes will overlap.
- 'equal': If *total* is given, the total space is divided in N equal
ranges and each box is left-aligned within its subspace.
Otherwise (*total* is *None*), *sep* must be provided and each box is
left-aligned in its subspace of width ``(max(widths) + sep)``. The
total width is then calculated to be ``N * (max(widths) + sep)``.
Parameters
----------
widths : list of float
Widths of boxes to be packed.
total : float or None
Intended total length. *None* if not used.
sep : float or None
Spacing between boxes.
mode : {'fixed', 'expand', 'equal'}
The packing mode.
Returns
-------
total : float
The total width needed to accommodate the laid out boxes.
offsets : array of float
The left offsets of the boxes.
)ÚfixedÚexpandÚequal)Úmoder/rNéÿÿÿÿr0ér1z@total and sep cannot both be None when using layout mode 'equal') rÚ
check_in_listÚnpÚcumsumÚlenÚsumÚmaxÚ
ValueErrorÚarange)ÚwidthsÚtotalÚsepr2Úoffsets_ÚoffsetsÚmaxhs rÚ_get_packed_offsetsrDFsfô\ ×ÑÒ3¸$Õ ˆw‚Ü—9‘9˜a˜S°VÖ#<° £GÒ#<Ñ=ˆØ˜3˜B-ˆØ ˆ˜RL &ˆgˆà
Ò ð ˆ=؈EÜ ˆv‹;˜Š?Øœ3˜v›;Ñ&¬3¨v«;¸©?Ñ;‰Càˆ—99˜a˜S°VÖ#<° £GÒ#<Ñ=ˆØ˜3˜B-ˆØgˆ~Ðà
ŠÜ6‹{ˆØ ˆ=؈ ð"=ó˜CZ¤3 v£;Ñ.‰Eàœ#˜f›+ÑÑ,ˆCؘ#‘:¤§¡¬3¨v«;Ó!7ÑØgˆ~Ðð
ùò'$=ùò$=s ´ D1
Â( D6
cóÚtjgd¢|¬«|td|D««}|dk(r7td|D««td|D««f}dgt |«z}||fS|dvrd|f}|Dcgc]\}}| Œ
}}}||fS|d vrd|f}|Dcgc]
\}}||z
Œ }}}||fS|d
k(r$d|f}|Dcgc]\}}|||z
z
d z|z
Œ}}}fScc}}wcc}}wcc}}w) 
Align boxes each specified by their ``(y0, y1)`` spans.
For simplicity of the description, the terminology used here assumes a
horizontal layout (i.e., vertical alignment), but the function works
equally for a vertical layout.
Parameters
----------
yspans
List of (y0, y1) spans of boxes to be aligned.
height : float or None
Intended total height. If None, the maximum of the heights
(``y1 - y0``) in *yspans* is used.
align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
The alignment anchor of the boxes.
Returns
-------
(y0, y1)
y range spanned by the packing. If a *height* was originally passed
in, then for all alignments other than "baseline", a span of ``(0,
height)`` is used without checking that it is actually large enough).
descent
The descent of the packing.
offsets
The bottom offsets of the boxes.
)ÚbaselineÚleftÚtopÚrightÚbottomÚcenter)Úalignc3ó,K|] \}}||z
Œy­wr©©Ú.0Úy0Úy1s rú <genexpr>z'_get_aligned_offsets.<locals>.<genexpr>¸sèø€Ò  RR˜"•WÑ2ùsrFc3ó&K|] \}}|Œ y­wrrNrOs rrSz'_get_aligned_offsets.<locals>.<genexpr>»sèø€Ò-™F˜B ”RÑ-ùóc3ó&K|] \}}|Œ y­wrrNrOs rrSz'_get_aligned_offsets.<locals>.<genexpr>»sèø€Ò2K¹&¸"¸b´2Ñ2KùrUr)rGrJ)rIrHrKçà?)rr5r:Úminr8)ÚyspansrrLÚyspanrBrQrRs rÚ_get_aligned_offsetsr[s<ô< ×ÑÚõOà
€~ÜÑ2¨6Ôà
ÒÜÑ- -¬sÑ2KÀFÔ2KÓ/KÐØ˜F Ñ#ˆð 'ˆð
Ð$Ñ $ØF ˆØ%+×,™6˜2˜rB,ˆÑ 'ˆð
Ð"Ñ "ØF ˆØ-3×4¡6 2 r6˜B“;Ð4ˆÑ
'ˆð
ØF ˆØ@F×G±f°b¸"F˜b 2™gÑ&¨"Ñ,¨rÓGˆÑ 'ˆùó-ùó5ùóHsÁ7
CÂC!Â<C'cóÆeZdZdZˆfdZˆfdZejjjd«ZdZ
dZ e d«Z
dZd „Zd
Zd Zd Zd
ZddZdZˆxZS)Ú OffsetBoxzÃ
A simple container artist.
The child artists are meant to be drawn at a relative position to its
parent.
Being an artist itself, all parameters are passed on to `.Artist`.
có~t||Ž|j|«|jd«g|_d|_y)NF©rr)ÚsuperÚ__init__Ú_internal_updateÚ set_clip_onÚ _childrenÚ_offset)rr!r"Ú __class__s €rrazOffsetBox.__init__Ós<ø€Ü
ј$ÑØ ×јfÔ
×Ñ˜ÔØˆŒØˆ rcópt||«|j«D]}|j|«Œy)
Set the `.Figure` for the `.OffsetBox` and all its children.
Parameters
----------
fig : `~matplotlib.figure.Figure`
N)r`Ú
set_figureÚ get_children)rÚfigÚcrfs €rrhzOffsetBox.set_figureÝs6ø€ô јØ× ˆ
L‰L˜Õ ñ rcó–tjjj||«|j «D] }|Œ||_Œyr)ÚmartistÚArtistÚaxesÚfsetri)rÚaxrks rrozOffsetBox.axesésBô ×Ñ× Ñ   × ˆ‰}Øñ rcó–|j|«rdifS|j«D]}|j|«\}}|sŒ||fcSdifS)a•
Delegate the mouse event contains-check to the children.
As a container, the `.OffsetBox` does not respond itself to
mouseevents.
Parameters
----------
mouseevent : `~matplotlib.backend_bases.MouseEvent`
Returns
-------
contains : bool
Whether any values are within the radius.
details : dict
An artist-specific dictionary of details of the event context,
such as which points are contained in the pick radius. See the
individual Artist subclasses for details.
See Also
--------
.Artist.contains
F)Ú_different_canvasriÚcontains)rÚ
mouseeventrkÚbs rrtzOffsetBox.containsñs^ð0 × !  ˜" Ø× ˆ—::˜jÓ)‰DˆAˆqÚØ˜!t’ ð ðbˆrcó ||_d|_y)a×
Set the offset.
Parameters
----------
xy : (float, float) or callable
The (x, y) coordinates of the offset in display units. These can
either be given explicitly as a tuple (x, y), or by providing a
function that converts the extent into the offset. This function
must have the signature::
def offset(width, height, xdescent, ydescent, renderer) -> (float, float)
TN)reÚstale©rÚxys rÚ
set_offsetzOffsetBox.set_offsetsðˆŒ Øˆ
rcóÂt|j«r?|j|j|j|j |j
|«S|jS)aO
Return the offset as a tuple (x, y).
The extent parameters have to be provided to handle the case where the
offset is dynamically determined by a callable (see
`~.OffsetBox.set_offset`).
Parameters
----------
bbox : `.Bbox`
renderer : `.RendererBase` subclass
)ÚcallablererrÚx0rQrs rr&zOffsetBox.get_offset#sMô ˜Ÿ Ô
L‰L˜Ÿ T§[¡[°4·7±7°(¸T¿W¹W¸HÀhÓ  ðð rcó ||_d|_y)zh
Set the width of the box.
Parameters
----------
width : float
TN)rry)rrs rÚ set_widthzOffsetBox.set_width6sðˆŒ
؈
rcó ||_d|_y)zj
Set the height of the box.
Parameters
----------
height : float
TN)rry)rrs rÚ
set_heightzOffsetBox.set_heightAsðˆŒ Øˆ
rcób|jDcgc]}|j«sŒ|Œc}Scc}w)z/Return a list of the visible child `.Artist`\s.)rdÚ get_visible)rrks rÚget_visible_childrenzOffsetBox.get_visible_childrenLs"àŸ>™>Ö=a¨Q¯]©]­_Ò=ùÒ=s,¥,có|jS)z'Return a list of the child `.Artist`\s.)rd©rs rrizOffsetBox.get_childrenPó à~‰~Ðrcótd«)a/
Return the bbox of the offsetbox and the child offsets.
The bbox should satisfy ``x0 <= x1 and y0 <= y1``.
Parameters
----------
renderer : `.RendererBase` subclass
Returns
-------
bbox
list of (xoffset, yoffset) pairs
z:get_bbox_and_offsets must be overridden in derived classes)ÚNotImplementedError©rrs rÚ_get_bbox_and_child_offsetsz%OffsetBox._get_bbox_and_child_offsetsTsô Jð Jrcó.|j|«\}}|S)z:Return the bbox of the offsetbox, ignoring parent offsets.)r)rrrrBs rÚget_bboxzOffsetBox.get_bboxfsà×ÓB‰
ˆˆg؈ rcóü|€ |jd¬«j«}|j|«} |j||«\}}|j ||«S#t$r|j«\}}YŒ0wxYw©NT©Úroot)Ú
get_figureÚ
_get_rendererrr&Ú TypeErrorÚ
translated)rrrÚpxÚpys rÚget_window_extentzOffsetBox.get_window_extentks|à РبDÓAˆ}‰}˜&ˆð—__ T¨8Ó4‰FˆBð˜r &øôò—_&‰FˆBð 'úsµAÁA;Á:A;có4|j|«\}}|j||«\}}t|j«|«D]2\}\}}|j ||z||zf«|j |«Œ4t
||dtd¬«¬«d|_y)zm
Update the location of children if necessary and draw them
to the given *renderer*.
©Úpad©ÚfillÚpropsN) rr&Úzipr†r|Údrawr-Údictry© rrrrBr˜r™rkÚoxÚoys rzOffsetBox.drawvs“ð
×8¸ÓB‰
ˆˆgØ  xÓ0‰ˆˆBܘt×:¸GÓ ‰KˆA‰x
L‰L˜"˜r™' ¡7Ð
F‰F ð ô T˜8¨%´tÀ´|Õˆ
rr)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rarhrmrnroÚsetterrtr|r)r&rr†rirrÚ
__classcell__©rfs@rr]r]Ês~ø„ñôô
ð
‡^Ñ×Ññó ðòò@ð$ñóðò$ ò òòJò$ó
 rr]có$eZdZ dˆfd„ ZˆxZS)Ú
PackerBasecó„t|«||_||_||_||_||_||_||_y)ao
Parameters
----------
pad : float, default: 0.0
The boundary padding in points.
sep : float, default: 0.0
The spacing between items in points.
width, height : float, optional
Width and height of the container box in pixels, calculated if
*None*.
align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
mode : {'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode.
- 'fixed' packs the given `.Artist`\s tight with *sep* spacing.
- 'expand' uses the maximal available space to distribute the
artists with equal spacing in between.
- 'equal': Each artist an equal fraction of the available space
and is left-aligned (or top-aligned) therein.
children : list of `.Artist`
The artists to pack.
Notes
-----
*pad* and *sep* are in points and will be scaled with the renderer
dpi, while *width* and *height* are in pixels.
N) r`rarrr?r2rLrd) rr?rrrLr2Úchildrenrfs €rrazPackerBase.__init__…sBø€ôH ÑÔØˆŒ ؈Œ
؈ŒØˆŒØˆŒ ؈Œ
Ø!ˆr)NNrFr/N)rar­s@rsø„Ø:>Ø:>÷++"rcóeZdZdZdZy)ÚVPackerzí
VPacker packs its children vertically, automatically adjusting their
relative positions at draw time.
.. code-block:: none
+---------+
| Child 1 |
| Child 2 |
| Child 3 |
+---------+
cóX|jd«}|j|z}|j|z}|jQ|j «D]>}t |t «sŒ|jdk(sŒ$|j|j«Œ@|j «Dcgc]}|j|«Œ}}t|Dcgc]}|jŒc}|j|j«\\}} }
t|Dcgc]}|jŒc}|j||j«\} } | | |Dcgc]}|jŒc}zz
} | d}
| |
z
} t!j"||
| |z
| «j%|«gt'|
| «¢fScc}wcc}wcc}wcc}w)ð?r0r)Úpoints_to_pixelsržr?rr†Ú
isinstancer°r2rrr[Ú intervalxrLrDrrRr
r Úpaddedr¢)rrÚdpicorržr?rkÚbboxesrrÚx1ÚxoffsetsrÚyoffsetsrs rrz#VPacker._get_bbox_and_child_offsetsÁs€à×*¨2ÓØh‰h˜ÑˆØh‰h˜Ñˆà :‰:Ð ×
,ܘa¤Õ·±¸8Ó1CØ—K‘K §
¡
Õ
15×0IÑ0IÓ0KÖL¨1!—**˜LˆÐ1Ø(.Ö ˆT^‹^Ò ·±¸T¿Z¹ZóIшˆR.Ø%+Ö ,˜TˆT[ ,¨d¯k©k¸3ÀÇ Á óKшð˜X¸VÖ(D°T¨¯«Ò(DÑØ˜A‘;ˆØ˜hÑ&ˆô
× Ñ ˜R ( ¨B°©G°VÓ <× CÀCÓ &Œc(˜  (ùòMùâ /ùâ ,ùâ(DsÂFÃFÄF"Ä;F'rrNrrr´r´³s ñ ó(rcóeZdZdZdZy)ÚHPackera 
HPacker packs its children horizontally, automatically adjusting their
relative positions at draw time.
.. code-block:: none
+-------------------------------+
| Child 1 Child 2 Child 3 |
+-------------------------------+
cóü|jd«}|j|z}|j|z}|j«Dcgc]}|j |«Œ}}|s)t j dddd«j|«gfSt|Dcgc]}|jŒc}|j|j«\\}} }
t|Dcgc]}|jŒc}|j||j«\} } |dj}
| |Dcgc]}|jŒc}|
z
z} t j |
|| | |z
«j|«gt!| |
«¢fScc}wcc}wcc}wcc}w)Nr¶r)r?r†rr
r r[Ú intervalyrrLrDrr2r)rrr?rkrrQrRr¿rrs rrz#HPacker._get_bbox_and_child_offsetsçsZà×*¨2ÓØh‰h˜ÑˆØh‰h˜Ñˆà04×0IÑ0IÓ0KÖL¨1!—**˜LˆÐÜ×# A q¨!¨QÓ6°sÓ;¸ 1Ø(.Ö ˆT^‹^Ò ·±¸d¿j¹jóJшˆR-Ø$*Ö +˜DˆTZ +¨T¯Z©Z¸¸d¿i¹ióIˆˆxðA‰Y\‰\ˆØ¨&Ö1 $d—g“gÒ1°BÑä× Ñ   R¨°°R±ÓÓ*”#Ó ,ùòMùò
0ùâ +ùò2sÁE*ÂE/ÃE4ÄE9NrÀrNrrÛs ñ ó,rcóFeZdZdZd
dddœˆfd ZdZdZd dZd „ZˆxZ S) Ú PaddedBoxaó
A container to add a padding around an `.Artist`.
The `.PaddedBox` contains a `.FancyBboxPatch` that is used to visualize
it when rendering.
.. code-block:: none
+----------------------------+
| |
| |
| |
| <--pad--> Artist |
| ^ |
| pad |
| v |
+----------------------------+
Attributes
----------
pad : float
The padding in points.
patch : `.FancyBboxPatch`
When *draw_frame* is True, this `.FancyBboxPatch` is made visible and
creates a border around the box.
FN)Ú
draw_frameÚ patch_attrsc ó®t|«||_|g|_t ddddddd|d¬« |_||j
j
|«y y )
a
Parameters
----------
child : `~matplotlib.artist.Artist`
The contained `.Artist`.
pad : float, default: 0.0
The padding in points. This will be scaled with the renderer dpi.
In contrast, *width* and *height* are in *pixels* and thus not
scaled.
draw_frame : bool
Whether to draw the contained `.FancyBboxPatch`.
patch_attrs : dict or None
Additional parameters passed to the contained `.FancyBboxPatch`.
©r@Úkr4 square,pad=0© r{rrÚ facecolorÚ edgecolorÚmutation_scaleÚsnapÚvisibleÚboxstyleN)r`rardrÚpatchÚupdate)rÚchildržrfs €rrazPaddedBox.__init__scø€ô ÑÔØˆŒØ˜ˆŒÜ ¨BØ SØØØØ

ˆŒ
ð Ð J‰J× Ñ ˜  #rcóž|j|jd«z}|jdj|«j |«dgfS)Nr¶rr_)rdr)rrs rrz%PaddedBox._get_bbox_and_child_offsets6sGàh‰h˜×2°2ÓØ˜qÑ*¨8Ó;¸@À6À(ÐKrcóN|j|«\}}|j||«\}}t|j«|«D]!\}\}}|j ||z||zf«Œ#|j |«|j«D]}|j
|«Œd|_y©NF)rr&r†r|rys rzPaddedBox.draw;à×ÓB‰
ˆˆgØ  xÓ0‰ˆˆBܘt×:¸GÓ -‰KˆA‰x
L‰L˜"˜r™' ¡7Ð 
˜Ô× ˆAØ
F‰F ð ðˆ
rcó–|jj|j«|r|jj|«d|_y©NT)Ú
set_boundsÚboundsÚset_mutation_scalery©rrÚfontsizes rÚ update_framezPaddedBox.update_frameIs4Ø
×јdŸk™kÔ Ø J‰J× )¨(Ô ˆ
rcóz|j|j|««|jj|«yr)s rzPaddedBox.draw_frameOs+à ×ј$×Ó
˜Õ!r)r)
rarr­s@rýs+ø„ñð6+°EÀtö+ò:Lò
óö "rcó‚eZdZdZd ˆfd„ Zed«Zejd«ZdZdZ dZ
dZ d „Z d
Z
d ZˆxZS)
Ú DrawingAreazí
The DrawingArea can contain any Artist as a child. The DrawingArea
has a fixed width and height. The position of children relative to
the parent is fixed. The children can be clipped at the
boundaries of the parent.
cóÌt|«||_||_||_||_||_tj«|_ tj«|_
y)a"
Parameters
----------
width, height : float
Width and height of the container box.
xdescent, ydescent : float
Descent of the box in x- and y-direction.
clip : bool
Whether to clip the children to the box.
N) r`rarrrrÚ_clip_childrenÚ mtransformsÚAffine2DÚoffset_transformÚ
dpi_transform)rrrrrÚcliprfs €rrazDrawingArea.__init__]sVø€ô ÑÔØˆŒ
؈Œ Ø ˆŒ
Ø ˆŒ
ØÔÜ +× 4Ñ 4Ó 6ˆÔÜÕrcó|jS)zl
If the children of this DrawingArea should be clipped
by DrawingArea bounding box.
)rˆs rÚ
clip_childrenzDrawingArea.clip_childrenqsð ×"rcó2t|«|_d|_y)Úboolræry)rÚvals rzDrawingArea.clip_childrenysä" 3iˆÔ؈
rcó4|j|jzS)zX
Return the `~matplotlib.transforms.Transform` applied to the children.
)rˆs rÚ
get_transformzDrawingArea.get_transform~sð×! D×$9Ñ$9Ñ9rcóy©z+
set_transform is ignored.
NrN©rÚts rÚ
set_transformzDrawingArea.set_transform„órcó˜||_|jj«|jj|d|d«d|_y©z¸
Set the offset of the container.
Parameters
----------
xy : (float, float)
The (x, y) coordinates of the offset in display units.
rr4TN©reÚclearÚ translateryrzs rr|zDrawingArea.set_offset‰óBðˆŒ Ø ×Ñ× ×Ñר1©¨r°!©uÔˆ
rcó|jS©zReturn offset of the container.©rerˆs rr&zDrawingArea.get_offset—ó à|‰|ÐrcóÀ|jd«}tj|j |z|j |z|j
|z|j |z«S)Nr¶)r
r rrrr)rrÚdpi_cors rrzDrawingArea.get_bboxsWà×+¨BÓÜ×ÑØ
]‰]ˆN˜ $ t§}¡} n°wÑ&>Ø J‰J˜Ñ  $§+¡+°Ñ"7ó 9rcó|jj|«|j«s|j|j ««|j
|j
|_|j
d¬«}||j|«yy)ú&Add an `.Artist` to the container box.NFr)rdÚappendÚis_transform_setr÷ror”rh)rrvrjs rÚ
add_artistzDrawingArea.add_artist¢spà ×јaÔ Ø×
O‰O˜D× 9‰9Ð Ø—Y‘YˆAŒFØo‰o 5ˆoÓØ ˆ?Ø
L‰L˜Õ ð rc óT|jd«}|jj«|jj|«t j
t
jddgd|jg|j|jg|jdgg«|j««}|jD]H}|jr)|js|js|j|«|j!|«ŒJt#||dt%d¬«¬«d|_y)Nr¶rFrœr)ÚscalerçÚTransformedPathÚmpathÚPathrrrdÚclipboxÚ _clippathÚ
set_clip_pathr£r-ry)rrrÚtpathrks rzDrawingArea.draw­ð×+¨BÓØ ×Ñ× Ñ Ô ×Ñ× Ñ  Ô
× J‰J˜˜A˜  D§K¡KÐ 0ØŸ T§[¡[П Q˜ð

× Ñ Ó ó "ˆð
ò ˆ×"¨A¯IªI¸¿ºØ Ô
F‰F ð ô
T˜8¨%´tÀ´|Õˆ
r)F)raÚpropertyrír|r&rr r­s@rUs^ø„ñõ4ð(ñð×Ññóðò  ò
òò örcó`eZdZdZdddœˆfd
ZdZdZdZd „Zd
Z d Z
d Z d
Z dZ
ˆxZS)ÚTextAreazõ
The TextArea is a container artist for a single Text instance.
The text is placed at (0, 0) with baseline+left alignment, by default. The
width and height of the TextArea instance is the width and height of its
child text.
NF)Ú textpropsÚmultilinebaselinecó^|i}tjdd|fi|¤Ž|_t|«|jg|_t
j«|_t
j«|_ |jj|j|jz«||_ y)
Parameters
----------
s : str
The text to be displayed.
textprops : dict, default: {}
Dictionary of keyword parameters to be passed to the `.Text`
instance in the TextArea.
multilinebaseline : bool, default: False
Whether the baseline for multiline text is adjusted so that it
is (approximately) center-aligned with single-line text.
Nr) ÚmtextÚTextÚ_textr`rardÚ_baseline_transformr÷Ú_multilinebaseline)rÚsrrrfs €rrazTextArea.__init__Îs“ø€ð" Р؈—Z 1 aÑ5¨9Ñ5ˆŒ
Ü
ÑÔØŸ*™*˜ˆŒÜ +× 4Ñ 4Ó 6ˆÔÜ#.×#7Ñ#7Ó#9ˆÔ Ø
× Ñ  ×!6Ñ!6Ø!%×!9Ñ!9ñ":ô ;à"3ˆÕrcóH|jj|«d|_y)z&Set the text of this area as a string.TN)rÚset_textry©rrs rr zTextArea.set_textêsà
×ј؈
rcó6|jj«S)z5Return the string representation of this area's text.)rÚget_textrˆs rr#zTextArea.get_textïsàz‰z×$rcó ||_d|_y)aX
Set multilinebaseline.
If True, the baseline for multiline text is adjusted so that it is
(approximately) center-aligned with single-line text. This is used
e.g. by the legend implementation so that single-line labels are
baseline-aligned, but multiline labels are "center"-aligned with them.
TN)rrys rÚset_multilinebaselinezTextArea.set_multilinebaselineósð#$ˆÔ؈
rcó|jS)z(
Get multilinebaseline.
)rrˆs rÚget_multilinebaselinezTextArea.get_multilinebaselineÿsð×&rcóyrNs rzTextArea.set_transformrcó˜||_|jj«|jj|d|d«d|_yrzs rr|zTextArea.set_offset
rcó|jSrrrˆs rr&zTextArea.get_offsetrrc ó¦tj|d|jj|jj «rdnd|j d¬«j ¬«\}}}|jj|«\}}}|j\}} |jj«t|«dkDr<|jr0d| zd||z
zz
}
|jjd ||
z
«|
}nt||z
| |z
«} | |z} |jj«} d | d
z | d œ| }
t!j"|
| || «S) lpÚTeXFTr)ÚismathÚdpir4rWré)rGrKrI)rÚ_get_text_metrics_with_cacherÚ_fontpropertiesÚ
get_usetexr”r/Ú _get_layoutÚsizerr8rr:Úget_horizontalalignmentr
r )rrÚh_Úd_rÚinfoÚydr@Úyd_newÚh_dÚhars rrzTextArea.get_bboxs5Ü× d˜DŸJ™J× ŸJ™J×3‘5¸Ø TÓ0‰ ˆˆ2ˆrð
Ÿ×Ó9‰ˆˆdy‰y‰ˆˆ1à × Ñ × ˆt9qŠ=˜Tט1‘W˜s b¨2¡g™Ñ.ˆFØ × $× .¨q°"°v±+Ô ‰Bäb˜2g˜q 2™vÓ&ˆbˆ
Z‰Z×
Ø A 2¨¡6°Q°BÑ
7¸Ñ
ä×Ñ  R C¨¨AÓ.rcóz|jj|«t||dtd¬«¬«d|_y©NFrœr)rr-rys rz
TextArea.draw4s+à
˜ÔT˜8¨%´tÀ´|Õˆ
r)rar r#r%r'r|r&rr­s@rrrÅsBø„ñð Ø#(ö4ò8ò

ò  ò
òò/ö0rrcóLeZdZdZˆfdZdZdZdZdZdZ dZ
d „Z ˆxZ S)
ÚAuxTransformBoxa…
An OffsetBox with an auxiliary transform.
All child artists are first transformed with *aux_transform*, then
translated with an offset (the same for all children) so the bounding
box of the children matches the drawn box. (In other words, adding an
arbitrary translation to *aux_transform* has no effect as it will be
cancelled out by the later offsetting.)
`AuxTransformBox` is similar to `.DrawingArea`, except that the extent of
the box is not predetermined but calculated from the window extent of its
children, and the extent of the children will be calculated in the
transformed coordinate.
có”||_t| «tj«|_tj«|_yr)Ú
aux_transformr`raÚref_offset_transform)rrErfs €rrazAuxTransformBox.__init__Js:ø€Ø*ˆÔÜ
ÑÔÜ +× 4Ñ 4Ó 6ˆÔô%0×$8Ñ$8Ó$:ˆÕ!rcó†|jj|«|j|j««d|_y)rTN)rdrry)rrvs rr zAuxTransformBox.add_artistRs0à ×јaÔ Ø ˜×ˆ
rcóN|j|jz|jzS)z0Return the `.Transform` applied to the children.)rErFrˆs rzAuxTransformBox.get_transformXs,à××× )rcóyrNs rzAuxTransformBox.set_transform^rcó˜||_|jj«|jj|d|d«d|_yrzs rr|zAuxTransformBox.set_offsetcrcó|jSrrrˆs rr&zAuxTransformBox.get_offsetqrrcó|jj«}|jj«|jj«|jDcgc]}|j |«Œ}}t
j|«}|jj|j |j «|jj|«t
jdd|j|j«Scc}w©Nr)Ú
get_matrixrFrdr
ÚunionrýrrQÚ
set_matrixr rr)rrÚ_offrkÚubs rrzAuxTransformBox.get_bboxuàר ×!× ×Ñ×%à9=¿¹ÖH°A% hÕHˆÐ
Z‰Z˜Ó
ˆà ×+¨R¯U©U¨F°R·U±U°FÔ ×Ñ×Ô×Ñ  1 b§h¡h°· ± Ó:ùò
IsÁDcóˆ|jD]}|j|«Œt||dtd¬«¬«d|_yrA)rdr-ry)rrrks rzAuxTransformBox.drawƒs:àò ˆAØ
F‰F ð äT˜8¨%´tÀ´|Õˆ
r)
rar r|r&rr­s@rrCrC;s0ø„ñ
ôò   ò
òò rrCc ó–eZdZdZdZdddddddd d
d d œ
Zd
dddddddœˆfd
ZdZdZdZ dZ
dZ ddZ e
d«ZddZdZˆxZS)ÚAnchoredOffsetboxa/
An OffsetBox placed according to location *loc*.
AnchoredOffsetbox has a single child. When multiple children are needed,
use an extra OffsetBox to enclose them. By default, the offset box is
anchored against its parent Axes. You may explicitly specify the
*bbox_to_anchor*.
ér4r0éééééé é
)
z upper rightz
upper leftz
lower leftz lower rightrIz center leftz center rightz lower centerz upper centerrKçš™™™™™Ù?rWNT)Ú borderpadrÖÚpropÚframeonÚbbox_to_anchorÚbbox_transformc óVt
|d
i| ¤Ž|j||«|j|«t |t
«r!t
j|j|¬«}||_ ||_
||_ |€#ttjd¬«|_nZtj |«|_t |t"«r0d|vr,|jj%tjd«t'ddddd |jj)«d
|d ¬ « |_y)a
Parameters
----------
loc : str
The box location. Valid locations are
'upper left', 'upper center', 'upper right',
'center left', 'center', 'center right',
'lower left', 'lower center', 'lower right'.
For backward compatibility, numeric values are accepted as well.
See the parameter *loc* of `.Legend` for details.
pad : float, default: 0.4
Padding around the child as fraction of the fontsize.
borderpad : float, default: 0.5
Padding between the offsetbox frame and the *bbox_to_anchor*.
child : `.OffsetBox`
The box that will be anchored.
prop : `.FontProperties`
This is only used as a reference for paddings. If not given,
:rc:`legend.fontsize` is used.
frameon : bool
Whether to draw a frame around the box.
bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
bbox_transform : None or :class:`matplotlib.transforms.Transform`
The transform for the bounding box (*bbox_to_anchor*).
**kwargs
All other parameters are passed on to `.OffsetBox`.
Notes
-----
See `.Legend` for a detailed description of the anchoring mechanism.
)ÚlocNúlegend.fontsize©r5r5r@TrÌrN)r`raÚset_bbox_to_anchorÚ set_childr¸ÚstrrÚ
check_getitemÚcodesrer_rÚmplÚrcParamsr`Ú _from_anyr¤Úset_sizerÚget_size_in_pointsrÔ) rrer_r`rarbrcr"rfs €rrazAnchoredOffsetbox.__init__£ø€ôL ÑÑ"˜ ×Ñ °Ô ä cœ3Ô Ü×$ T§Z¡Z°SÔ9ˆCàˆŒØŒØˆŒà ˆ&¬C¯L©LÐ9JÑ,KÔLˆD&×Ó6ˆDŒIܘÔ%¨&¸Ñ*<Ø ×"¤3§<¡<Ð0AÑ#BÔ ¨BØ SØŸ9™9רØ

ˆ
rcóF||_||j|_d|_y)zSet the child to be anchored.NT)Ú_childrory)rs rrizAnchoredOffsetbox.set_childås!àˆŒ Ø Ð ØŸˆEŒJ؈
rcó|jS)zReturn the child.©rsrˆs rÚ get_childzAnchoredOffsetbox.get_childìs à{‰{Ðrcó|jgS)zReturn the list of children.rurˆs rrizAnchoredOffsetbox.get_childrenðsà ˆ}ÐrcóÎ|j|jj««}|j|z}|j «j |«j
|«Sr)r`rqrvr)rrs rrzAnchoredOffsetbox.get_bboxôsPà×,¨T¯Y©Y×-IÑ-IÓ-KÓØh‰h˜ÑØ~‰~Ó×Ó2×9¸>rcó¦|j|jjS|j}| |jSt |j|«S)z,Return the bbox that the box is anchored to.)Ú_bbox_to_anchorrorÚ_bbox_to_anchor_transformr )rÚ transforms rÚget_bbox_to_anchorz$AnchoredOffsetbox.get_bbox_to_anchorúsLà × Ñ Ð —99—> ×6ˆÐ Ø×& t×';Ñ';¸Grcóü|t|t«r||_n4 t|«}|dk(r |d|dddg}t
j|Ž|_||_d|_ y#t$r}t d|«|d}~wwxYw)aB
Set the bbox that the box is anchored to.
*bbox* can be a Bbox instance, a list of [left, bottom, width,
height], or a list of [left, bottom] where the width and
height will be assumed to be zero. The bbox will be
transformed to display coordinate by the given transform.
NzInvalid bbox: r0rr4T)
r¸r rzr8rr;r
r r{ry)rrr|Úerrs rrhz$AnchoredOffsetbox.set_bbox_to_anchorsð ˆ<œ: d¬HÔ5Ø#'ˆ ð
Cܘ“IðAŠvؘQ™  ¨!¨QÐ/ä#'×#3Ñ#3°TÐ#:ˆ à)2ˆÔˆ
øôò
CÜ  >°$°Ð!8Ó9¸Bûð
Cúsœ AÁ A;Á'A6Á6A;c óT|j|j|jj««z}|j «}t |j tjdd|j|j«||«\}}||jz
||jz
fSrM)
r_r`rqr}Ú_get_anchored_bboxrer
r rrrrQ)rrrrbrrQs rr&zAnchoredOffsetbox.get_offsetð~‰~Ø×*¨4¯9©9×+GÑ+GÓ+IÓKˆà×Ü H‰H”d×& q¨!¨T¯Z©Z¸¿¹Ó ˜Có!‰ˆˆBðD—GG‰|˜R $§'¡'™\Ð)rcóŠ|jj|j«|r|jj|«yyr)s rzAnchoredOffsetbox.update_frame)s2Ø
×јdŸk™kÔ Ø J‰J× )¨(Õ  rcóÊ|j«sy|j|«}|j|jj ««}|j ||«|j j|«|j|j|«|«\}}|j«j||f«|j«j|«d|_ y)
r…r`rqr&rrvr|ry)rrrr˜r™s rzAnchoredOffsetbox.draw.à×ÑÔ ð×% hÓØ×,¨T¯Y©Y×-IÑ-IÓ-KÓØ ×ј$ Ô
˜Ô §¡¨xÓ!8¸(ÓC‰ˆˆBØ Ó×# R¨ HÔ Ó×јhÔˆ
rr)Úzorderrlrarirvrirr}rhr)r&r­s@rrUrUø„ñð€FðØØØØØØØØØñ
€Eð CØ Ø $Ø $ö @
òDòòò Hóð2ñð
rrUcóngd¢|}|j| «}|j||¬«jS)z}
Return the (x, y) position of the *bbox* anchored at the *parentbbox* with
the *loc* code with the *borderpad*.
) NEÚNWÚSWÚSEÚWrÚC)Ú container)ÚanchoredÚp0)rerÚ
parentbboxr_rkrs rrr?s:ò EÀSÑI€AØ×! 9 -€IØ =‰=˜ iˆ 0× 3rcó,eZdZdZddddœˆfd
ZˆxZS)Ú AnchoredTextz&
AnchoredOffsetbox with Text.
r^rWN)r_r`c óò|i}ddh}|t|«zr td«t||¬«|_|jjj «}t
‰ ||f|||j|dœ|¤Žy)aq
Parameters
----------
s : str
Text.
loc : str
Location code. See `AnchoredOffsetbox`.
pad : float, default: 0.4
Padding around the text as fraction of the fontsize.
borderpad : float, default: 0.5
Spacing between the offsetbox frame and the *bbox_to_anchor*.
prop : dict, optional
Dictionary of keyword parameters to be passed to the
`~matplotlib.text.Text` instance contained inside AnchoredText.
**kwargs
All other parameters are passed to `AnchoredOffsetbox`.
vaÚverticalalignmentz<Mixing verticalalignment with AnchoredText is not supported.)r)r_r`)Úsetr;rÚtxtrÚget_fontpropertiesr`ra)
rrrer_r`r"Ú badkwargsÚfprfs
€rrazAnchoredText.__init__Psˆø€ð0 ˆˆDØÐ/ˆ Ø ”s˜4“yÒ ÜØPð
Pô˜A¨ÔŒØ
X‰X^‰^×
0ˆÜ
ÑØ ð Ø I°T·X±XÀBñ àó r)rar­s@rr•r•Ksø„ñð'*°S¸#ò#rr•c
ódeZdZddddddddddœ ˆfd
ZdZd „Zd
Zd Zd Zd
Z dZ
dZ ˆxZ S)Ú OffsetImager4NTg@F) ÚzoomÚcmapÚnormÚ
interpolationÚoriginÚ
filternormÚ filterradÚresamplerc óÞt |«|
|_td|j||||||| dœ| ¤Ž|_|j
g|_|j|«|j|«y)N)rrN) r`raÚ_dpi_corrÚimagerdÚset_zoomÚset_data)
rÚarrr rr"rfs
€rrazOffsetImage.__init__xsvø€ô ÑÔØˆŒ
äð ! D×$:Ñ$:Ø$(Ø$(Ø-:Ø&,Ø*4Ø)2Ø(0ñ "(ñ !ˆŒ
ðŸ*™*˜ˆŒà
Ø
rcótj|«|_|jj |j«d|_y)r6ÚasarrayÚ_datarªry)rr­s rzOffsetImage.set_data˜s.Ü—Z“_ˆŒ
Ø
×јDŸJ™JÔˆ
rcó|jSr)rˆs rÚget_datazOffsetImage.get_dataó Øz‰zÐrcó ||_d|_y)Ú_zoomry)rr s rzOffsetImage.set_zoom s؈Œ
؈
rcó|jSr)rˆs rÚget_zoomzOffsetImage.get_zoom¤rcó|jSrrrˆs rr&zOffsetImage.get_offset§rrcó|jgSr)rˆs rrizOffsetImage.get_children«sØ
ˆrcóô|jr|jd«nd}|j«}|j«}|jdd\}}||z|z||z|z}}t j dd||«S)Nr¶r0r)Úshaper
r ) rrrr ÚdataÚnyÚnxr@r<s rrzOffsetImage.get_bbox®suØ37·=²=(×+¨BÔ/ÀbˆØ}‰}‹ˆØ}‰}‹ˆØ˜B˜QˆˆBؘ‰|˜" G¨b¡L°4Ñ$7ˆ1ˆÜ×Ñ  1 a¨Ó+rcóH|jj|«d|_y)rys rzOffsetImage.draw¶sà
˜Ôˆ
r)
rar&rirr­s@rvsNø„ðØØØØ ØØØöò@ò
òòòòòrc
óöeZdZdZdZdZejdddddddddœd „«Ze d
«Z
e
jd «Z
e d «Z e jd
«Z dZ
dZdZddZdZddZddZdZdZy)ÚAnnotationBboxzâ
Container for an `OffsetBox` referring to a specific position *xy*.
Optionally an arrow pointing from the offsetbox to *xy* can be drawn.
This is like `.Annotation`, but with `OffsetBox` instead of `.Text`.
rWcóLd|jddd|jdddS)NzAnnotationBbox(rÚ,r4ú))r{rˆs rÚ__str__zAnnotationBbox.__str__Ès+Ø  §¡¨¡¨A ¨a°·±¸±
¸1¨~¸?rNTr^©rWrW)raÚannotation_clipÚ
box_alignmentÚ bboxpropsÚ
arrowpropsràc
ó´tjj|«tjj||||¬«||_| | j
«nd|_|j| «||n||_ ||n||_
| |_ | <|jjdd«|_
td
i|j¤Ž|_nd|_
d|_t!ddddd|j"j%«d |¬
«|_|j&j)d |¬ «|
r|j&j*di|
¤Ž|j-|
«y)a
Parameters
----------
offsetbox : `OffsetBox`
xy : (float, float)
The point *(x, y)* to annotate. The coordinate system is determined
by *xycoords*.
xybox : (float, float), default: *xy*
The position *(x, y)* to place the text at. The coordinate system
is determined by *boxcoords*.
xycoords : single or two-tuple of str or `.Artist` or `.Transform` or callable, default: 'data'
The coordinate system that *xy* is given in. See the parameter
*xycoords* in `.Annotation` for a detailed description.
boxcoords : single or two-tuple of str or `.Artist` or `.Transform` or callable, default: value of *xycoords*
The coordinate system that *xybox* is given in. See the parameter
*textcoords* in `.Annotation` for a detailed description.
frameon : bool, default: True
By default, the text is surrounded by a white `.FancyBboxPatch`
(accessible as the ``patch`` attribute of the `.AnnotationBbox`).
If *frameon* is set to False, this patch is made invisible.
annotation_clip: bool or None, default: None
Whether to clip (i.e. not draw) the annotation when the annotation
point *xy* is outside the Axes area.