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

803 lines
82 KiB
Plaintext
Raw Normal View History

Ë
†Rj…ãóú—dZddlZddlZddlZddlmZddlZddlZddl Z
ddl Z
ddl Z
ddl mZmZddl mZddl­ddlmZddlmZddlmZddlmZddlmZmZm Z m!Z!m"Z"m#Z#m$Z$ejJe&«Z'id ejP“d
ejP“d ejP“d ejR“d
ejT“dejV“dejX“dejZ“dej\“dej^“dej`“dejb“dejd“dejf“dejh“dejj“dejl“ejnejpejPdœ¥Z9e:e9«Z;d3d„Z< d4d„Z=dddœd„Z>d „Z?Gd!„d"ej€«ZAGd#„d$eA«ZBGd%„d&eB«ZCGd'„d(eB«ZDGd)„d*eA«ZEGd+„d,eA«ZFd4d-„ZG d5ddd.œd/„ZHd0„ZId1„ZJ d6d2„ZKy)7zR
The image module supports basic image loading, rescaling and display
operations.
éN)ÚPath)Ú_apiÚcbook)Ú_image)Ú*)ÚFigureCanvasBase)ÚAffine2DÚBboxBaseÚBboxÚ
BboxTransformÚBboxTransformToÚIdentityTransformÚTransformedBboxÚautoÚnoneÚnearestÚbilinearÚbicubicÚspline16Úspline36ÚhanningÚhammingÚhermiteÚkaiserÚquadricÚcatromÚgaussianÚbesselÚmitchellÚsinc)ÚlanczosÚblackmanÚ antialiasedc
óÔ—t|«dk(r(tjdtj¬«ddfSg}g}|D]‰}|j ||«\}}}} |€Œ||z}||z}|j ||||j
«f«|j t||g||jdz||jdzgg««Œ‹t|«dk(r(tjdtj¬«ddfStj|«}
tjt|
j«t|
j«dftj¬«} |D]d\}}}} t«j||
j z
||
j"z
«} t%j&|| | t$j(d| ¬«Œf| |
j |z |
j"|z fS)a5
Composite a number of RGBA images into one. The images are
composited in the order in which they appear in the *images* list.
Parameters
----------
images : list of Images
Each must have a `make_image` method. For each image,
`can_composite` should return `True`, though this is not
enforced by this function. Each image must have a purely
affine transformation with no shear.
renderer : `.RendererBase`
magnification : float, default: 1
The additional magnification to apply for the renderer in use.
Returns
-------
image : (M, N, 4) `numpy.uint8` array
The composited RGBA image.
offset_x, offset_y : float
The (left, bottom) offset where the composited image should be placed
in the output figure.
r)rré©Údtypeér%F©ÚresampleÚalpha)ÚlenÚnpÚemptyÚuint8Ú
make_imageÚappendÚ_get_scalar_alphar ÚshapeÚunionÚzerosÚintÚheightÚwidthr Ú translateÚx0Úy0rr*ÚNEAREST)
ÚimagesÚrendererÚ
magnificationÚpartsÚbboxesÚimageÚdataÚxÚyÚtransÚbboxÚoutputr+s
úS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/image.pyÚcomposite_imagesrJ<sº€ô4 ˆ6ƒ{�aÒÜ�x‰x˜ ¬¯©Ô2°A°qÐ8Ð8à €EØ
€FØòHˆØ!×,Ñ,¨X°}ÓEшˆa��EØ Ñ Ø
�Ñ ˆAØ
�Ñ ˆAØ �L‰L˜$  1 e×&=Ñ&=Ó&?Ð@Ô AØ �M‰MÜ�q˜!�f˜q 4§:¡:¨a¡=Ñ0°!°d·j±jÀ±mÑ2CÐDÐEÓFõ
Hð
Hô ˆ5ƒz�Q‚Ü�x‰x˜ ¬¯©Ô2°A°qÐ8Ð8ä �:‰:�fÓ €Dä
�X‰XÜ ˆT�[‰[Ó œ3˜tŸz™z›?¨AÐ.´b·h±hô@€Fð#ò5шˆa��EÜ“
×$Ñ$ Q¨¯©¡[°!°d·g±g±+Ó>ˆÜ�‰˜˜f e¬V¯^©^Ø!&¨eö 5ð5ð
�4—7‘7˜]Ñ*¨D¯G©G°mÑ,CÐ CÐCóc󶇇‡‡ —td„|D««}|�|n‰j«}|s|s|D]}|j‰«ŒygЉj«Š ˆˆ ˆˆfd„}|D]l}t |t
«rB|j
«r2|j«r"|j«s‰j|«ŒU|«|j‰«Œn|«y)a
Draw a sorted list of artists, compositing images into a single
image where possible.
For internal Matplotlib use only: It is here to reduce duplication
between `Figure.draw` and `Axes.draw`, but otherwise should not be
generally useful.
c3ó<K—|]}t|t«–—Œy­w©N)Ú
isinstanceÚ
_ImageBase©Ú.0rDs rIú <genexpr>z0_draw_list_compositing_images.<locals>.<genexpr>~sèø€Ò@°1”Z ¤:×.Ñ@ùs‚Nc󲕗t‰«dk(r‰dj‰«n®t‰«dkDr t‰‰‰«\}}}|jdk7r€‰j «}|j ‰j «|j‰j««‰j|t|«t|«|«|j«‰dd…=y)Nr(r) r,ÚdrawrJÚsizeÚnew_gcÚset_clip_rectanglerGÚ
set_clip_pathÚ
get_clip_pathÚ
draw_imageÚroundÚrestore)rCÚlÚbÚgcÚ image_groupÚmagÚparentr>s €€€€rIÚ flush_imagesz3_draw_list_compositing_images.<locals>.flush_imagesŒs¯ø€Ü�;Ó 1Ò$ؘA‘×#Ñ# HÕ-Ü�[Ó! AÒ%Ü-¨k¸8ÀSÓI‘
��a˜Ø—9‘9 ’>Ø!Ÿ™Ó*�BØ×)Ñ)¨&¯+©+Ô6Ø×$Ñ$ V×%9Ñ%9Ó%;Ô<Ø×'Ñ'¨¬E°!«H´e¸A³hÀÔEØ—J‘J”LØšA‘rK)
ÚanyÚoption_image_nocompositerUÚget_image_magnificationrOrPÚ
can_compositeÚ get_clip_onrZr1)
r>rcÚartistsÚsuppress_compositeÚ
has_imagesÚ
not_compositeÚardrarbs
`` @@rIÚ_draw_list_compositing_imagesrotsÉû€ôÑ@¸Ô@Ó@€Jð,>Ð+IÑ'Ø"×;Ñ;Ó=ðñ™JØò ˆAØ
�F‰F�8Õ ñ ðˆ Ø×.Ñ.Ó0ˆ÷ ðò !ˆAܘ1œjÔ)¨a¯o©oÔ.?Ø—M‘M”O¨A¯O©OÔ,=Ø×"Ñ" 1Õ%á”Ø—‘�xÕ ð
 !ñ �rKr(r)c ó°—d}|jddkDr|tj|jd¬««t t j |jddz ««}|dd…dd|…f}t«j|d«|z}|jddkDr|tj|jd ¬««t t j |jddz ««}|dd|…dd…f}t«jd|«|z}|j«}|d
v�r!t jddg|jd|jdgg«} |j| «}
t jt j|
dd…df««} t jt j|
dd…df««} | d |jdzkDs'| |jdk(s| d |jdzk(r?| d |jdzkDs'| |jdk(s| d |jdzk(rd
}nd}t j||jd dz|j«}
|€|j!«}t#j$||
|t&||||j)«|j+««|
S)a
Convenience wrapper around `._image.resample` to resample *data* to
*out_shape* (with a third dimension if *data* is RGBA) that takes care of
allocating the output array and fetching the relevant properties from the
Image object *image_obj*.
zŸData with more than {n} cannot be accurately displayed. Downsampling to less than {n} before displaying. To remove this warning, manually downsample your data.r(i€z
2**23 columns)ÚnNriz
2**24 rows©r#réérr)r3ÚwarningsÚwarnÚformatr6r-Úceilr ÚscaleÚget_interpolationÚarrayÚ transformÚabsÚdiffr5r'Ú get_resamplerr*Ú _interpd_Úget_filternormÚ
get_filterrad)Ú image_objrCÚ out_shaper|r*r+ÚmsgÚstepÚ
interpolationÚposÚdispÚdispxÚdispyÚouts rIÚ _resampler�£sw€ð D€Cð ‡z�z�!�}�uÒÜ�
‰
�c—j‘j ?�jÓ3Ô4Ü”2—7‘7˜4Ÿ:™: a™=¨5Ñ0Ó1Ó2ˆØ’A‘v˜�v�I‰ˆÜ“J×$Ñ$ T¨1Ó-° Ñ9ˆ Ø ‡z�z�!�}�uÒÜ�
‰
�c—j‘j <�jÓ0Ô1Ü”2—7‘7˜4Ÿ:™: a™=¨5Ñ0Ó1Ó2ˆØ‘F�d�FšA�I‰ˆÜ“J×$Ñ$ Q¨Ó-° Ñ9ˆ ð×/Ñ/Ó1€MØÐ/Ò/ô�h‰h˜˜A˜ §¡¨A¡°·
±
¸1±
Ð >Ð?Ó@ˆØ×"Ñ" 3Ó'ˆÜ—‘”r—w‘w˜t¢A q D™zÓ*Ó+ˆÜ—‘”r—w‘w˜t¢A q D™zÓ*Ó+ˆØ
�Q˜Ÿ™ A™Ñ&Ò
&ؘŸ™ A™Ò&ؘ˜TŸZ™Z¨™]Ñ*Ò*Ø
�Q˜Ÿ™ A™Ñ&Ò
&ؘŸ™ A™Ò&ؘ˜TŸZ™Z¨™]Ñ*Ò*Ø%‰Mà%ˆMÜ
�(‰(�9˜tŸz™z¨!¨"˜~Ñ-¨t¯z©zÓ
:€CØÐØ×)Ñ)Ó+ˆÜ
‡O�O�D˜#˜yܘmÑ,ØØØ×,Ñ,Ó.Ø×+Ñ+Ó-ô /ð €JrKcó —tj|jd|jddf|j¬«}||dd…dd…dd…f<|jtjk(rd|dd…dd…df<|Sd|dd…dd…df<|S) z\
Convert an RGB image to RGBA, as required by the image resample C++
extension.
rr(r%r&Nrséÿçð?)r-r5r3r'r/)ÚAÚrgbas rIÚ _rgb_to_rgbar“Ûs~€ô
�8‰8�Q—W‘W˜Q‘Z §¡¨¡¨QÐ/°q·w±wÔ ?€DØ€DŠŠAˆr�ˆrˆ�NØ ‡z�z”R—X‘XÒØˆŠQ’�1ˆW‰
ð €KðˆŠQ’�1ˆW‰
Ø €KrKcó‡—eZdZdZdZ d!ddœˆfd„ Zd„Zˆfd„Zd„Zd „Z d
„Z
d „Z ˆfd „Z d"d
„Z
d#d„Zd„Zej"d„«Zd„Zd„Zed„«Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#ˆxZ$S)$rPa»
Base class for images.
interpolation and cmap default to their rc settings
cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1
extent is data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.
Additional kwargs are matplotlib.artist properties
rN)Úinterpolation_stagec
 󘕗t‰ |�|j|||««|€tjd}t j ddg|¬«||_|j|«|j|«|j|«|j|
«|j| «||_
d|_|j| «y)Nú image.originÚupperÚlower©Úorigin)ÚsuperÚ__init__Ú_get_colorizerÚmplÚrcParamsrÚ
check_in_listr›Úset_filternormÚ
set_filterradÚset_interpolationÚset_interpolation_stageÚ set_resampleÚaxesÚ_imcacheÚ_internal_update)
ÚselfÚaxÚcmapÚnormÚ colorizerr‡r›Ú
filternormÚ filterradr*r•ÚkwargsÚ __class__s
€rIr�z_ImageBase.__init__ús³ø€ô ‰Ñ˜×,Ñ,¨T°4¸ÓCÔDØ ˆ>Ü—\‘\ .Ñ1ˆFÜ ×јG WÐ-°fÕ=؈Œ Ø ×јJÔ'Ø ×ј9Ô%Ø ×ј}Ô-Ø ×$Ñ$Ð%8Ô9Ø ×ј(Ô#؈Œ àˆŒ
à ×јfÕ%rKcó¢— |j«}t|«j›d|›d�S#t$rt|«jcYSwxYw)Nz(shape=ú))Ú get_shapeÚtypeÚ__name__Ú RuntimeError)rªr3s rIÚ__str__z_ImageBase.__str__sP€ð 'Ø—N‘NÓ$ˆEܘ4“j×)Ñ)Ð*¨'°%°¸!Ð<Ð <øÜò 'ܘ“:×&Ñ&Ò &ð 'ús‚*-­AÁ
Acó,•—it‰|�«¥ddi¥S)Nr¨)rœÚ __getstate__©rªr²s €rIr»z_ImageBase.__getstate__sø€à;”%‘'Ñ&Ó(Ð;¨*°dÑ;Ð;rKcó(—|j«ddS)z9Return the size of the image as tuple (numrows, numcols).Nrt)rµ©rªs rIÚget_sizez_ImageBase.get_size"s€à�~‰~Ó  Ð#Ð#rKcó\—|j€ td«‚|jjS)zV
Return the shape of the image as tuple (numrows, numcols, channels).
ú"You must first set the image array)Ú_Ar¸r3r¾s rIrµz_ImageBase.get_shape&s'€ð �7‰7ˆ?ÜÐCÓDÐ Dà�w‰w�}‰}ÐrKcó–—tjj||«tj|«dvr t d«‚d|_y)z®
Set the alpha value used for blending - not supported on all backends.
Parameters
----------
alpha : float or 2D array-like or None
)rrtz5alpha must be a float, two-dimensional array, or NoneN)ÚmartistÚArtistÚ_set_alpha_for_arrayr-ÚndimÚ TypeErrorr¨)rªr+s rIÚ set_alphaz_ImageBase.set_alpha/sA€ô �‰×+Ñ+¨D°%Ô8Ü
�7‰7�5‹> Ñ 'Üð-ó.ð
.�
rKcóz—|j�"tj|j«dkDrdS|jS)a¥
Get a scalar alpha value to be applied to the artist as a whole.
If the alpha value is a matrix, the method returns 1.0 because pixels
have individual alpha values (see `~._ImageBase._make_image` for
details). If the alpha value is a scalar, the method returns said value
to be applied to the artist as a whole because pixels do not have
individual alpha values.
rr�)Ú_alphar-rÇr¾s rIr2z_ImageBase._get_scalar_alpha=s5€ð—k‘kÐ)¬R¯W©W°T·[±[Ó-AÀAÒ-Eˆsð Ø—‘ð rKcó0•—d|_t‰|� «y)zU
Call this whenever the mappable is changed so observers can update.
N)r¨rœÚchangedr¼s €rIrÍz_ImageBase.changedJsø€ðˆŒ
Ü
‰‰ÕrKc
ó$—|€ td«‚|jdk(r td«‚tj||«}|€y|j|z} |j
|z}
| dk(s|
dk(ry|j dk(r9t«jd|jd «jdd«} n
t«} | t«j|j|jdz |j
|jdz «j|j|j«|j«zz
} | t«j|j |j «j|«z} |s|| jrp|rn| d zd
k7s|
d zd
k7r^t!j"| «}
t!j"|
«}|
| z
| z }||
z
|
z }| t«jd |zd |z«z
} nt%| «}
t%|
«}||
f}|�s}|j&d k(s9|j&d k(r|jdd
vst)d|j›d�«‚|j*}|dvrÓt-j.ddg|jd|jdgg«}| j1|«}t-j2t-j4|dd…df««|jdz }t-j2t-j4|dd…df««|jdz }|d ks|d krd}nd}|j&d k(�rt|dk(�rn|j6j8dk(rzt-j6|j6j:dkDrdnd«}|j:|j6j:krot=j>d|j6›d|›d�«nH|jA«jCd«|jE«jCd«z
}|dkDrdnd}tG||jC|«|| «}tI|jJtLjN«r|jC|j6«}|jPj|jk(rUt-jR|jPt-jTt,jV«t-jTd««n#t-jX|t,jT«}tG|||| d¬«}~t-jZ|«}d||<|j]«}|�+t-j&|«dkDr|tG|||| d¬«z}t,j^ja||«}|jK|«}�nd|j&d k(r,|jJjc|«|je|«}|j]«}|€d|jd d k(r"|j6t,jfk(rdnd } ntG||d|| «} tG|ti|ddd …f«|| «}n®t-j&|«dkDr-tG|||| «} tG|ti|ddd …f«|| «}ni|jd d k(r%|j6t,jfk(rd|zn|} ntG||d|| «|z} tG|ti|ddd …f«|| «}| |d<|je|dd ¬!«}|j&d k(�r¢|jk«}|dd…dd…d f}!|!jCt,jT«z|z|!dd�n\|jl€&|je|d|j&d k(¬!«|_6|jl}to|| jq««js«}"|t%tA|"jtd««t%tE|"jvdz|jd««…t%tA|"jxd««t%tE|"jzdz|jd««…f}t«jt%tA|"jxd««t%tA|"jtd«««| z} ||j|j| fS)"aÆ
Normalize, rescale, and colormap the image *A* from the given *in_bbox*
(in data space), to the given *out_bbox* (in pixel space) clipped to
the given *clip_bbox* (also in pixel space), and magnified by the
*magnification* factor.
Parameters
----------
A : ndarray
- a (M, N) array interpreted as scalar (greyscale) image,
with one of the dtypes `~numpy.float32`, `~numpy.float64`,
`~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`.
- (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
`~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.
in_bbox : `~matplotlib.transforms.Bbox`
out_bbox : `~matplotlib.transforms.Bbox`
clip_bbox : `~matplotlib.transforms.Bbox`
magnification : float, default: 1
unsampled : bool, default: False
If True, the image will not be scaled, but an appropriate
affine transformation will be returned instead.
round_to_pixel_border : bool, default: True
If True, the output image size will be rounded to the nearest pixel
boundary. This makes the images align correctly with the Axes.
It should not be used if exact scaling is needed, such as for
`.FigureImage`.
Returns
-------
image : (M, N, 4) `numpy.uint8` array
The RGBA image, resampled unless *unsampled* is True.
x, y : float
The upper left corner where the image should be drawn, in pixel
space.
trans : `~matplotlib.transforms.Affine2D`
The affine transformation from image to pixel space.
Nz9You must first set the image array or the image attributerzk_make_image must get a non-empty image. Your Artist's draw method must filter before this method is called.)NrrNr˜r(éÿÿÿÿr�çrtrs©rsr%úInvalid shape ú for image datarrr’rCÚfr%Úf8Úf4zCasting input data from z to z for imshow.g„×—AT)r*r�).rs.F©Úbytesr­)>r¸rVr Ú intersectionr8r7r›r r9r3ryrr:r;Ú
get_transformÚ is_affineÚmathrxr6rÇÚ
ValueErrorÚ_interpolation_stager-r{r|r}r~r'ÚkindÚitemsizerÚ
warn_externalÚmaxÚastypeÚminr�rOr­ÚmcolorsÚNoNormÚmaskÚwhereÚfloat32ÚnanÚ ones_likeÚisnanÚ get_alphaÚmaÚ masked_arrayÚautoscale_NoneÚto_rgbar/r“r2r¨rÚinvertedÚfrozenÚyminÚymaxÚxminÚxmax)#rªr‘Úin_bboxÚout_bboxÚ clip_bboxr?Ú unsampledÚround_to_pixel_borderÚ clipped_bboxÚout_width_baseÚout_height_baseÚt0ÚtÚ out_widthÚ
out_heightÚ extra_widthÚ extra_heightr„r•rˆr‰rŠr‹Ú scaled_dtypeÚdaÚ A_resampledrçÚ out_alphaÚout_maskr+Úresampled_maskedrHÚ output_alphaÚ
alpha_channelÚsubsets# rIÚ _make_imagez_ImageBase._make_imageQsÔ€ð\
ˆ9Üð >ó?ð
?à �6‰6�QŠ;Üð 8ó9ð
9ô×(Ñ(¨°9Ó=ˆ à Ð Ø#à%×+Ñ+¨mÑ;ˆØ&×-Ñ-°
Ñ=ˆà ˜QÒ  /°QÒ"6Ø#à �;‰;˜'Ò !ô“×%Ñ% a¨!¯'©'°!©*¨Ó5×;Ñ;¸A¸rÓB‰Bä"Ó$ˆBà
Ü ‹Jß
‰UØ—
‘
 §¡¨¡
Ñ*Ø—‘ §¡¨¡Ñ+ó-÷‰Y�w—z‘z 7§:¡:Ó
.Ø× Ñ Ó"ñ 
#ñ $ˆðÜ“
ß‘˜LŸO™OÐ+¨l¯o©oÐ-=Ó>ß‘�}Ó%ñ'ˆñ § ¢ Ñ0EØ #Ñ%¨Ò,°À#Ñ0EÈÒ0LÜŸ ™  .Ó1ˆIÜŸ™ ?Ó3ˆJØ$ ~Ñ5¸ÑGˆKØ&¨Ñ8¸OÑKˆLØ
”“×!Ñ! #¨ Ñ"3°S¸<Ñ5GÓHÑ H‰Aä˜NÓ+ˆIܘ_Ó-ˆJØ Ð+ˆ âØ—F‘F˜a’K 1§6¡6¨Q¢;°1·7±7¸2±;À&Ñ3HÜ  >°!·'±'°¸/Ð!JÓKÐKð#'×";Ñ";Ð Ø"Ð&=Ñ=Ü—h‘h  A ¨¯©°©°Q·W±W¸Q±ZÐ(@ÐAÓB�Ø—{‘{ 3Ó'�ÜŸ™œrŸw™w tªA¨q¨D¡zÓ2Ó3°a·g±g¸a±jÑ@�ÜŸ™œrŸw™w tªA¨q¨D¡zÓ2Ó3°a·g±g¸a±jÑ@�ؘA’I 5¨1¢9Ø*0Ñ'à*0Ð'à�v‰v˜‹{Ð2°fÓ<ð —7‘7—<‘< 3Ò&Ü#%§8¡8°A·G±G×4DÑ4DÀqÒ4H©DÈdÓ#S�LØ#×,Ñ,¨q¯w©w×/?Ñ/?Ò?Ü×*Ñ*Ð-EÀaÇgÁgÀYØ-1°,°¸|ð,MõNð Ÿ™›Ÿ™¨Ó-°·±³·±¸tÓ0DÑD�BØ+-°ª8¡4¸�Lô(¨¨a¯h©h°|Ó.DÀiÐQRÓS� ô˜dŸi™i¬¯©Ô8Ø"-×"4Ñ"4°Q·W±WÓ"=�KðŸ6™6Ÿ<™<¨1¯7©7Ò2ôŸ™ §¡¬¯©´B·F±FÓ);¼R¿Z¹ZÈ»]ÔKäŸ\™\¨!¬R¯Z©ZÓ8ðô
& d¨D°)¸QÈÔN� ØÜŸ8™8 IÓ.�Ø&'� ˜(Ñ#àŸ™Ó(�ØÐ$¬¯©°«¸!Ò);ؤ¨4°¸ À1ÈtÔ!TÑT�Iä#%§5¡5×#5Ñ#5°kÀ8Ó#LÐ ØŸ™Ð#3Ó4’à—6‘6˜Q’;Ø—I‘I×,Ñ,¨QÔ/ØŸ ™  Q›�AØŸ™Ó(�Ø�=Ø—w‘w˜q‘z Q’Ø./¯g©g¼¿¹Ò.A¡sÀs™ ä'0Ø  ! F¡)¨Y¸ó(;˜ ä&Øœl¨1¨S°"°1°"¨W©:Ó6¸ À1óF‘Fä—W‘W˜U“^ aÒ'ä#,¨T°5¸)ÀQÓ#G�LÜ&Øœl¨1¨S°"°1°"¨W©:Ó6¸ À1óF‘Fð—w‘w˜q‘z Q’Ø89¿¹Ä2Ç8Á8Ò8K¨¨eª ÐQV™ ä'0°°q¸±yÀ)ÈQÓ'OÐRWÑ'W˜ Ü&Øœl¨1¨S°"°1°"¨W©:Ó6¸ À1óF�Fà!-��v‘ð—\‘\ &°¸5�\ÓAˆFð�v‰v˜‹{Ø×.Ñ.Ó0�Ø &¢qª!¨Q w¡�
à!×(Ñ(¬¯©Ó4°yÑ@À5ÑHð™aÒ ð�}‰}Ð$Ø $§ ¡ ¨Q°dÀ!Ç&Á&ÈAÁ+  Ó O�”
Ø—]‘]ˆFô% Y°· ± ³
Ó>×EÑEÓGˆFØÜ”C˜Ÿ ™  QÓ'Ó(Ü”C˜Ÿ ™  a™¨¯©°a©Ó9Ó:ð;ä”C˜Ÿ ™  QÓ'Ó(Ü”C˜Ÿ ™  a™¨¯©°a©Ó9Ó:ð;ð;ñ<ˆFô “
×$Ñ$Ü”C˜Ÿ ™  QÓ'Ó(¬#¬c°&·+±+¸qÓ.AÓ*BóDØFGñHˆAð�|—‘¨ ¯©¸Ð:Ð:rKcó—td«‚)aŽ
Normalize, rescale, and colormap this image's data for rendering using
*renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an
appropriate affine transformation will be returned instead.
Returns
-------
image : (M, N, 4) `numpy.uint8` array
The RGBA image, resampled unless *unsampled* is True.
x, y : float
The upper left corner where the image should be drawn, in pixel
space.
trans : `~matplotlib.transforms.Affine2D`
The affine transformation from image to pixel space.
z(The make_image method must be overridden©ÚNotImplementedError)rªr>r?rûs rIr0z_ImageBase.make_image-s€ô$"Ð"LÓMÐMrKcó—y)z|
Return whether the image is better to be drawn unsampled.
The derived class needs to override it.
F©r¾s rIÚ_check_unsampled_imagez!_ImageBase._check_unsampled_imageAs€ð rKcó`—|j«sd|_y|j«jdk(rd|_y|j «}|j |«|j
|j««|j|j««|j|j««|j«r‘|j«r�|j«jrg|j!|d¬«\}}}}|�ˆt#«j%|j&d|j&d«|z}|j)|||||«n;|j!||j+««\}}}}|�|j)||||«|j-«d|_y)NFrT©rûr()Ú get_visibleÚstaleÚ get_arrayrVrWÚ _set_gc_cliprÉr2Úset_urlÚget_urlÚset_gidÚget_gidÚoption_scale_imagerrÚrÛr0r ryr3r[rgr])rªr>r`Úimr^r_rFs rIrUz_ImageBase.drawIsa€ð×ÑÔ!؈DŒJØ à �>‰>Ó × Ñ  AÒ %؈DŒJØ à
�_‰_Ó
ˆØ ×ј"ÔØ
� ‰ �T×+Ñ+Ó-Ô.Ø
�
‰
�4—<‘<“>Ô"Ø
�
‰
�4—<‘<“>Ô"Ø × 'Ñ 'Ô )Ø×/Ñ/Ô1Ø×&Ñ&Ó(×2Ò2Ø"Ÿo™o¨hÀ$˜oÓG‰OˆB��1�e؈~Ü ›
×(Ñ(¨¯©°!©°b·h±h¸q±kÓBÀUÑJ�Ø×#Ñ# B¨¨1¨b°%Õ8à"Ÿo™oؘ(×:Ñ:Ó<ó>‰OˆB��1�eàˆ~Ø×#Ñ# B¨¨1¨bÔ1Ø
�
‰
Œ ؈�
rKcó~—|j|«s|jj|«dsdifS|j«j «}|j |j |jg«\}}|j«\}}}}|duxr$||z
||z
zdkxr|duxr||z
||z
zdk} | ifS)ú7Test whether the mouse event occurred within the image.rFN) Ú_different_canvasr§ÚcontainsrÚròr|rDrEÚ
get_extent)
rªÚ
mouseeventrFrDrErör÷rôrõÚinsides
rIr%z_ImageBase.containshsÖ€à × "Ñ " :Ô .à—y‘y×)Ñ)¨*Ó5°aÒ8ؘ"�9Ð ð
×"Ñ"Ó$×-Ñ-Ó/ˆØ�‰ 
§ ¡ ¨j¯l©lÐ;Ó<‰ˆˆ1Ø!%§¡Ó!2шˆd�D˜$à˜4�-òE Q¨¡X°!°d±(Ñ$;¸qÑ$@òEؘt�mòEØ)*¨T©°a¸$±hÑ(?À1Ñ(Dð à�rˆzÐrKcóâ—|j|jdk(r|jddd…n |jdd¬«}tjj |«j
|d¬«y)z$Write the image to png file *fname*.r™NrÏTr×Úpng)rw)rñr›rÂÚPILÚImageÚ fromarrayÚsave)rªÚfnamer!s rIÚ write_pngz_ImageBase.write_pngzs[€à
�\‰\¨4¯;©;¸'Ò+A˜$Ÿ'™'¡$ B $š-ÀtÇwÁwØ $¨4ðó1ˆä � ‰ ×јBÓ×$Ñ$ U°5Ð$Õ9rKcó—tj|d¬«}|jtjk7r>tj
|jt d«std|j›d�«‚|jdk(r#|jddk(r|jd«}|jd k(s9|jdk(r|jdd
vstd |j›d �«‚|jdk(�r tj|jtj«rd
nd}|j«dks||j«krJtj!d|j«|j««tj"|d|«}|jtjk7rMtj|jtj«r|j%tj«}|S)z|
Check validity of image-like input *A* and normalize it to a format suitable for
Image subclasses.
T)ÚcopyÚ same_kindzImage data of dtype z cannot be converted to floatrsrÏr(rtrÑrÒrÓr�rz�Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). Got range [%s..%s].)rÚsafe_masked_invalidr'r-r/Úcan_castÚfloatrÈrÇr3ÚsqueezeÚ
issubdtypeÚintegerrärâÚ_logÚwarningÚcliprã)r‘Úhighs rIÚ_normalize_image_arrayz!_ImageBase._normalize_image_array€st€ô
× %Ñ % a¨dÔ 3ˆØ �7‰7”b—h‘hÒ ¤r§{¡{°1·7±7¼EÀ;Ô'OÜÐ2°1·7±7°)ð<1ð2ó3ð
3à �6‰6�QŠ;˜1Ÿ7™7 2™;¨!Ò+Ø— ‘ ˜"“
ˆAØ—‘˜!’ ˜qŸv™v¨š{¨q¯w©w°r©{¸fÑ/Dܘn¨Q¯W©W¨I°_ÐEÓFÐ FØ �6‰6�Q‹;ô
Ÿ-™-¨¯©´·±Ô<‘3À!ˆDØ�u‰u‹w˜Š{˜d Q§U¡U£WšnÜ— ‘ ð*ð—E‘E“G˜QŸU™U›Wô ô —G‘G˜A˜q $Ó'�à�w‰wœ"Ÿ(™(Ò"¤r§}¡}°Q·W±W¼b¿j¹jÔ'IØ—H‘HœRŸX™XÓ&�؈rKcóª—t|tjj«r t|«}|j |«|_d|_d|_y)zÄ
Set the image array.
Note that this function does *not* update the normalization used.
Parameters
----------
A : array-like or `PIL.Image.Image`
NT)rOr+r,Ú pil_to_arrayr>rÂr¨r©rªr‘s rIÚset_dataz_ImageBase.set_data¡s?€ô �aœŸ™Ÿ™Ô )ܘQ“ˆAØ×-Ñ-¨aÓ0ˆŒØˆŒ
؈�
rKcó&—|j|«y)zŒ
Retained for backwards compatibility - use set_data instead.
Parameters
----------
A : array-like
N)rBrAs rIÚ set_arrayz_ImageBase.set_array±s€ð
�
‰
�aÕrKcó—|jS)aH
Return the interpolation method the image uses when resizing.
One of 'auto', 'antialiased', 'nearest', 'bilinear', 'bicubic',
'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos',
or 'none'.
)Ú_interpolationr¾s rIrzz_ImageBase.get_interpolation½s€ð×"Ñ"Ð"rKcóž—tj|d«j«}tjt
|¬«||_d|_y)a9
Set the interpolation method the image uses when resizing.
If None, use :rc:`image.interpolation`. If 'none', the image is
shown as is without interpolating. 'none' is only supported in
agg, ps and pdf backends and will fall back to 'nearest' mode
for other backends.
Parameters
----------
s : {'auto', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None
zimage.interpolation©r‡TN)rŸÚ
_val_or_rcr™rr¡Úinterpolations_namesrFr©rªÚss rIr¤z_ImageBase.set_interpolationÈs>€ô
�N‰N˜1Ð3Ó 4× :Ñ :Ó <ˆÜ ×ÑÔ/¸qÕAØˆÔØˆ�
rKcó—|jS)zy
Return when interpolation happens during the transform to RGBA.
One of 'data', 'rgba', 'auto'.
)rÞr¾s rIÚget_interpolation_stagez"_ImageBase.get_interpolation_stageÜs€ð ×(Ñ(Ð(rKcó~—tj|d«}tjgd¢|¬«||_d|_y)a©
Set when interpolation happens during the transform to RGBA.
Parameters
----------
s : {'data', 'rgba', 'auto'} or None
Whether to apply up/downsampling interpolation in data or RGBA
space. If None, use :rc:`image.interpolation_stage`.
If 'auto' we will check upsampling rate and if less
than 3 then use 'rgba', otherwise use 'data'.
zimage.interpolation_stage)rCr’r)rLTN)rŸrIrr¡rÞrrKs rIr¥z"_ImageBase.set_interpolation_stageäs5€ô
�N‰N˜1Ð9Ó :ˆÜ ×ÑÒ3°qÕ9Ø$%ˆÔ!؈�
rKcóx—|j«}|jdk7xr|jxr |jS)z>Return whether the image can be composited with its neighbors.r)rÚrFrÛÚ is_separable)rªrFs rIrhz_ImageBase.can_compositeõs=€à×"Ñ"Ó$ˆà × Ñ  6Ñ )ò
Ø �O‰Oò
à × Ñ ð rKcóL—tj|d«}||_d|_y)z¦
Set whether image resampling is used.
Parameters
----------
v : bool or None
If None, use :rc:`image.resample`.
zimage.resampleTN)rŸrIr�r)rªÚvs rIr¦z_ImageBase.set_resampleýs#€ô
�N‰N˜1Ð.Ó /ˆØˆŒØˆ�
rKcó—|jS)z(Return whether image resampling is used.)r�r¾s rIrz_ImageBase.get_resample
s €à�~‰~ÐrKcó2—t|«|_d|_y)z¯
Set whether the resize filter normalizes the weights.
See help for `~.Axes.imshow`.
Parameters
----------
filternorm : bool
TN)ÚboolÚ _filternormr©rªr¯s rIr¢z_ImageBase.set_filternorms€ô  
Ó+ˆÔ؈�
rKcó—|jS)z8Return whether the resize filter normalizes the weights.)rWr¾s rIr�z_ImageBase.get_filternorms€à×ÑÐrKcóV—t|«}|dkr td«‚||_d|_y)zÅ
Set the resize filter radius only applicable to some
interpolation schemes -- see help for imshow
Parameters
----------
filterrad : positive float
rz+The filter radius must be a positive numberTN)r6rÝÚ
_filterradr)rªr°Úrs rIr£z_ImageBase.set_filterrads/€ô
�)Ó ˆØ �Š6ÜÐJÓKÐ K؈ŒØˆ�
rKcó—|jS)zReturn the filterrad setting.)r[r¾s rIr‚z_ImageBase.get_filterrad.s €à�‰ÐrK)NNNNNTç@F)r�FT©r�F)%r·Ú
__module__Ú __qualname__Ú__doc__Úzorderr�r¹r»r¿rµrÉr2rÍrr0rrÄÚallow_rasterizationrUr%r0Ú staticmethodr>rBrDrzr¤rNr¥rhr¦rr¢r�r£r‚Ú
__classcell__©r²s@rIrPrPésñø„ñ
ð€FðØØØ#ØØ ØØð&ð&*ö&ò:'ô<ò$òò ò ôðJMØ;?óZ;óxNò(ð
× Ñ ñó!ðò<ò$:ð ñóðò@ò
ò #òò()òò" ò òò ò ò
örKrPc ób‡—eZdZdZdddddddddddœ
ˆfd„
Zdd„Zdd „Zd
„Zd „Zd „Z d
„Z
ˆxZ S)Ú AxesImagear
An image with pixels on a regular grid, attached to an Axes.
Parameters
----------
ax : `~matplotlib.axes.Axes`
The Axes the image will belong to.
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
The Colormap instance or registered colormap name used to map scalar
data to colors.
norm : str or `~matplotlib.colors.Normalize`
Maps luminance to 0-1.
interpolation : str, default: :rc:`image.interpolation`
Supported values are 'none', 'auto', 'nearest', 'bilinear',
'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
'sinc', 'lanczos', 'blackman'.
interpolation_stage : {'data', 'rgba'}, default: 'data'
If 'data', interpolation
is carried out on the data provided by the user. If 'rgba', the
interpolation is carried out after the colormapping has been
applied (visual interpolation).
origin : {'upper', 'lower'}, default: :rc:`image.origin`
Place the [0, 0] index of the array in the upper left or lower left
corner of the Axes. The convention 'upper' is typically used for
matrices and images.
extent : tuple, optional
The data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.
filternorm : bool, default: True
A parameter for the antigrain image resize filter
(see the antigrain documentation).
If filternorm is set, the filter normalizes integer values and corrects
the rounding errors. It doesn't do anything with the source floating
point values, it corrects only integers according to the rule of 1.0
which means that any sum of pixel weights must be equal to 1.0. So,
the filter function must produce a graph of the proper shape.
filterrad : float > 0, default: 4
The filter radius for filters that have a radius parameter, i.e. when
interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
resample : bool, default: False
When True, use a full resampling method. When False, only resample when
the output image is larger than the input image.
**kwargs : `~matplotlib.artist.Artist` properties
NTr^F)
r¬r­r®r‡r›Úextentr¯r°r*r•c
óH•—||_t‰
|�|f||||||| |
| dœ | ¤Žy)N) r¬r­r®r‡r›r¯r°r*r•)Ú_extentrœr�)rªr«r¬r­r®r‡r›rjr¯r°r*r•r±r²s €rIr�zAxesImage.__init__csFø€ðˆŒ ä
‰ÑØ ð
àØØØ'ØØ!ØØØ 3ñ
ðó
rKcó”—|j\}}}}tj||||g«}|j|j ««SrN)rlr Ú from_extentsÚ transformedrÚ)rªr>r:Úx1r;Úy1rGs rIÚget_window_extentzAxesImage.get_window_extent‚sF€ØŸ™‰ˆˆB��BÜ× Ñ  " b¨"¨bÐ!1Ó2ˆØ×Ñ × 2Ñ 2Ó 4Ó5Ð5rKcó–—|j«}|j«\}}}}ttj||g||gg««} t | |«}
|j
«r(|j«xs2|jjn|jd¬«j} |j|j| |
| ||¬«S)NT©Úrootr)
rÚr&r r-r{rriÚ get_clip_boxr§rGÚ
get_figurerrÂ) rªr>r?rûrFrpÚx2rqÚy2rGÚtransformed_bboxr<s rIr0zAxesImage.make_image‡sº€à×"Ñ"Ó$ˆàŸ™Ó*‰ˆˆB��BÜ”B—H‘H˜r 2˜h¨¨R¨Ð1Ó2Ó3ˆÜ*¨4°Ó7ÐØ;?×;KÑ;KÔ;M�×"Ñ"Ó$Ò6¨¯ © ¯ªØ—_‘_¨$�_Ó/×4Ñ4ð
à×Ñ §¡¨Ð/?ÀØ -¸ð óDð DrKcó(—|j«dk(S)z9Return whether the image would be better drawn unsampled.r)rzr¾s rIrz AxesImage._check_unsampled_image“s€à×%Ñ%Ó'¨6Ñ1Ð1rKc ó˜—|jjd|d|dgfd|d|dgfg|«\\}}\}}|rtjd|«‚|jj ||j
«}|jj ||j
«}|jj ||j «}|jj ||j «}||||g}||_||f||ff}|jj|«||g|jjdd||g|jjdd|jj«r|jj||fd¬ «|jj«r|jj||fd¬ «d
|_y) a
Set the image extent.
Parameters
----------
extent : 4-tuple of float
The position and size of the image as tuple
``(left, right, bottom, top)`` in data coordinates.
**kwargs
Other parameters from which unit info (i.e., the *xunits*,
*yunits*, *zunits* (for 3D Axes), *runits* and *thetaunits* (for
polar Axes) entries are applied, if present.
Notes
-----
This updates `.Axes.dataLim`, and, if autoscaling, sets `.Axes.viewLim`
to tightly fit the image, regardless of `~.Axes.dataLim`. Autoscaling
state is not changed, so a subsequent call to `.Axes.autoscale_view`
will redo the autoscaling in accord with `~.Axes.dataLim`.
rDrr(rErtrsÚ
set_extentN)rT)r§Ú_process_unit_inforÚ kwarg_errorÚ_validate_converted_limitsÚconvert_xunitsÚconvert_yunitsrlÚupdate_datalimÚ sticky_edgesrDrEÚget_autoscalex_onÚset_xlimÚget_autoscaley_onÚset_ylimr)rªrjr±rör÷rôrõÚcornerss rIr}zAxesImage.set_extent—sµ€ð*&*§Y¡Y×%AÑ%AØ�F˜1‘I˜v a™yÐ)Ð
*Ø�F˜1‘I˜v a™yÐ)Ð
*ð
,à ó&Ñ"‰ ˆˆt‘l�t˜Tñ Ü×"Ñ" <°Ó8Ð 8Ø�y‰y×3Ñ3Ø �$×%Ñ%ó'ˆà�y‰y×3Ñ3Ø �$×%Ñ%ó'ˆà�y‰y×3Ñ3Ø �$×%Ñ%ó'ˆà�y‰y×3Ñ3Ø �$×%Ñ%ó'ˆà˜˜d DÐ)ˆàˆŒ ؘ�,  t  Ð,ˆØ � ‰ × Ñ  Ô)Ø"&¨ ˆ×Ñ×Ñ™AÐØ"&¨ ˆ×Ñ×Ñ™AÐØ �9‰9× &Ñ &Ô (Ø �I‰I× Ñ   d˜|°$Ð Ô 7Ø �9‰9× &Ñ &Ô (Ø �I‰I× Ñ   d˜|°$Ð Ô 7؈�
rKcóª—|j� |jS|j«}|\}}|jdk(r d|dz
|dz
dfSd|dz
d|dz
fS)ú<Return the image extent as tuple (left, right, bottom, top).r˜çà¿çà?)rlr¿r›)rªÚszÚnumrowsÚnumcolss rIr&zAxesImage.get_extentÇse€à �<‰<Ð #Ø—<‘<Ð à—‘“ˆBØ!Ñ ˆG�WØ�{‰{˜gÒ%ؘg c™k¨7°3©;¸Ð=Ð=à˜g c™k¨4°¸±Ð=Ð=rKcó|—|j«\}}}}|jdk(r||}}|j«}t||g||gg«}tddg|jd|jdgg«}|j «j
«} | t||¬«z
} | j|j|jg«}
ttj|
««ry|
jt«\} } d| cxkr|jdkrnyd| cxkr|jdksyy|| | fS)zÇ
Return the image value at the event position or *None* if the event is
outside the image.
See Also
--------
matplotlib.artist.Artist.get_cursor_data
r˜rr()ÚboxinÚboxoutN)r&r›rr r3rÚròr r|rDrErer-rìrãr6)
rªÚeventrör÷rôrõÚarrÚ data_extentÚ array_extentrFÚpointÚjÚis
rIÚget_cursor_datazAxesImage.get_cursor_dataÓs*€ð"&§¡Ó!2шˆd�D˜$Ø �;‰;˜'Ò !ؘt�$ˆDØ�n‰nӈܘT 4˜L¨4°¨,Ð7Ó8ˆ ܘa ˜V c§i¡i°¡l°C·I±I¸a±LÐ%AÐBÓCˆ Ø×"Ñ"Ó$×-Ñ-Ó/ˆØ
” [¸ÔFÑFˆØ—‘ §¡¨%¯'©'Ð 2Ó3ˆÜ Œr�x‰x˜‹Ô ØØ�|‰|œCÓ ‰ˆˆ1à�QÔ%˜Ÿ™ 1™Ô%Øð01°AÔ/D¸¿ ¹ À!¹ Ò/DØð0EØà�q˜!�t‘9Ð rKrNr_) r·r`rarbr�rrr0rr}r&r›rfrgs@rIriri3sNø„ñ-ðbØØØ#ØØØ ØØØ%)ö
ó>6ó
Dò2ò.ò`
>örKricóx‡—eZdZdZddœˆfd„
Zd„Zdd„Zd„Zd„Zˆfd „Z d
„Z
d „Z d „Z ˆfd
„Z
ˆfd„Zd„ZˆxZS)ÚNonUniformImagea
An image with pixels on a rectilinear grid.
In contrast to `.AxesImage`, where pixels are on a regular grid,
NonUniformImage allows rows and columns with individual heights / widths.
See also :doc:`/gallery/images_contours_and_fields/image_nonuniform`.
rrHc óH•—t‰|�|fi|¤Ž|j|«y)ae
Parameters
----------
ax : `~matplotlib.axes.Axes`
The Axes the image will belong to.
interpolation : {'nearest', 'bilinear'}, default: 'nearest'
The interpolation scheme used in the resampling.
**kwargs
All other keyword arguments are identical to those of `.AxesImage`.
N)rœr�r¤)rªr«r‡r±r²s €rIr�zNonUniformImage.__init__ùs%ø€ô ‰Ñ˜Ñ&˜vÒ&Ø ×ј}Õ-rKcó—y)z)Return False. Do not use unsampled image.Frr¾s rIrz&NonUniformImage._check_unsampled_images€àrKcóŒ —|j€ td«‚|r td«‚|j}|jdk(rm|jt
j k7r|j|d¬«}nçt j|dd…dd…t
jfdd«}d|dd…dd…df<n«|jt
j k7r"d|zjt
j «}|jddk(rZt jtg|jd d¢d‘«t
j «}||dd…dd…d d…f<d|dd…dd…df<|}|jjj \}}}} t#t%|«d
zt%|«d
z
z
|z«}
t#t%| «d
zt%|«d
z
z
|z«} |jj&j)«} | j+t j,|||
«D�
cgc]}
|
|f‘Œc}
«dd…d f}| j+t j,|| | «D�cgc]}||f‘Œc}«dd…d f}|j.d k(�r|j0dd
|j0d dzdz }|j2dd
|j2d dzdz }|j5|«}|j5|«}t j6|«j9t
j:«j=«t
j>jA||jd z|«j9t
j «jC| |
df«}�n©t jD|j0j5|«d z
d tG|j0«dz
«}t jD|j2j5|«d z
d tG|j2«dz
«}t
j>jA||jd z|«}t jDt jH||j0|z
t jJ|j0«|t
jL¬«d d «}t jDt jH||j2|z
t jJ|j2«|t
jL¬«d d «}t j@d |z
d |z
«}t j@|d |z
«}t j@d |z
|«}t j@||«}t jN| |
dft
j «}tQd«D]x}|dd…dd…|fjCd
«}|||z}||||jd d|zz
}|||d d|zz
}||||jd d zd|zz
}||dd…dd…|f<Œz|||tS«fScc}
wcc}w)NrÁz*unsampled not supported on NonUniformImagertT©rØr%r�rsrr�r(rrÏr&)*rÂr¸rÝrÇr'r-r/rñÚrepeatÚnewaxisrãr3r5Útupler§rGÚextentsr6r\Ú transDataròr|ÚlinspacerFÚ_AxÚ_AyÚ searchsortedÚascontiguousarrayÚviewÚuint32ÚravelÚaddÚouterÚreshaper<r,Údivider~rér.Úranger) rªr>r?rûr‘ÚBr^r_r\rr8r7ÚinvertedTransformrDÚx_pixrEÚy_pixÚx_midÚy_midÚx_intÚy_intr!Úidx_intÚx_fracÚy_fracÚf00Úf10Úf01Úf11ÚchanÚacÚbufs rIr0zNonUniformImage.make_image sK€à �7‰7ˆ?ÜÐCÓDÐ DÙ ÜÐIÓJÐ JØ �G‰GˆØ �6‰6�QŠ;Ø�w‰wœ"Ÿ(™(Ò"Ø—L‘L ¨$�LÓ/‘ä—I‘I˜a¢¢1¤b§j¡jÐ 0Ñ1°1°aÓ8�Ø �’!’Q˜�'’
à�w‰wœ"Ÿ(™(Ò"ؘ‘U—N‘N¤2§8¡8Ó,�Ø�w‰w�q‰z˜QŠÜ—H‘HœUÐ#5 Q§W¡W¨Q¨q \Ð#5°1Ð#5Ó6¼¿¹ÓA�Ø �’!’Q˜˜!˜�)‘ Ø �’!’Q˜�'‘
Ø�Ø—Y‘Y—^‘^×+Ñ+‰
ˆˆ1ˆa�Ü”e˜A“h ‘n¬¨q«°C©Ñ8¸MÑIÓJˆÜ”u˜Q“x #‘~¬%°«(°S©.Ñ9¸]ÑJÓKˆà ŸI™I×/Ñ/×8Ñ8Ó:ÐØ!×+Ñ+ÜŸ[™[¨¨A¨uÓ5Ö 6˜ˆa�ŠVÒ 6ó8Ú89¸1¸ñ>ˆà!×+Ñ+ÜŸ[™[¨¨A¨vÓ6Ö 7˜ˆa�ŠVÒ 7ó9Ú9:¸A¸ñ?ˆð × Ñ  )Ó +Ø—X‘X˜c˜r�] T§X¡X¨a¨b \Ñ1°QÑ6ˆEØ—X‘X˜c˜r�] T§X¡X¨a¨b \Ñ1°QÑ6ˆEØ×&Ñ& uÓ-ˆEØ×&Ñ& uÓ-ˆEô
×$Ñ$ QÓ'×,Ñ,¬R¯Y©YÓ7×=Ñ=Ó?Ü—F‘F—L‘L ¨¯©°©Ñ!3°UÓ;ñ=ç‘”b—h‘h“§¡¨°¸Ð(:Ó ;ò
ô —G‘GØ—‘×%Ñ% eÓ,¨qÑ0°!´S¸¿¹³]ÀQÑ5FóHˆEä—G‘GØ—‘×%Ñ% eÓ,¨qÑ0°!´S¸¿¹³]ÀQÑ5FóHˆEä—f‘f—l‘l 5¨1¯7©7°1©:Ñ#5°uÓ=ˆGÜ—W‘WÜ— ‘ ˜% $§(¡(¨5¡/Ñ1´2·7±7¸4¿8¹8Ó3DÀUÑ3KÜ "§
¡
ô,à�1óˆFô—W‘WÜ— ‘ ˜% $§(¡(¨5¡/Ñ1´2·7±7¸4¿8¹8Ó3DÀUÑ3KÜ "§
¡
ô,à�1óˆFô—(‘(˜1˜v™: q¨6¡zÓ2ˆCÜ—(‘(˜6 1 v¡:Ó.ˆCÜ—(‘(˜1˜v™: vÓ.ˆCÜ—(‘(˜6 6Ó*ˆCÜ—‘˜6 5¨!Ð,¬b¯h©hÓ7ˆBܘa›ò
%�Ø’qš!˜T�z‘]×*Ñ*¨2Ó.�ð˜B˜w™KÑ'�Ø�s˜R §¡¨¡
  ˜_¨WÑ5Ñ5Ñ5�Ø�s˜R  ˜V G™_Ñ,Ñ,�Ø�s˜R §¡¨¡
¨Q¡ Ð0°Ñ9Ñ9Ñ9�Ø!$�’1’a˜�:’ð
%ð�1�aÔ*Ó,Ð,Ð,ùò[
7ùâ 7s È X<É Ycó¼—|j|«}tj|tj«}tj|tj«}|j|jcxk(rdk(r6n t
d«‚|j
dd|j
|j
zk(s t
d«‚||_||_||_ d|_
d|_ y)až
Set the grid for the pixel centers, and the pixel values.
Parameters
----------
x, y : 1D array-like
Monotonic arrays of shapes (N,) and (M,), respectively, specifying
pixel centers.
A : array-like
(M, N) `~numpy.ndarray` or masked array of values to be
colormapped, or (M, N, 3) RGB array, or (M, N, 4) RGBA array.
r(NrtzAxes don't match array shapeT) r>r-r{rérÇr3rÈrÂr¨r©r¨r©rªrDrEr‘s rIrBzNonUniformImage.set_dataUs­€ð
× 'Ñ '¨Ó *ˆÜ �H‰H�QœŸ
™
Ó #ˆÜ �H‰H�QœŸ
™
Ó #ˆØ—‘˜!Ÿ&™&Ô% AÔ%ÜÐ:Ó;Ð ;ð+,¯'©'°"°1¨+¸¿¹À1Ç7Á7Ñ9JÒ*JÜÐ:Ó;Ð ;؈ŒØˆŒØˆŒØˆŒ
؈�
rKcó—td«‚©NzMethod not supportedr©rªÚargss rIrDzNonUniformImage.set_arraymó€Ü!Ð"8Ó9Ð9rKcóF•—|�|dvr td«‚t‰|� |«y)z�
Parameters
----------
s : {'nearest', 'bilinear'} or None
If None, use :rc:`image.interpolation`.
N)rrz?Only nearest neighbor and bilinear interpolations are supported)rrœr¤)rªrLr²s €rIr¤z!NonUniformImage.set_interpolationps4ø€ð
ˆ=˜QÐ&=Ñ=Ü%ð'NóOð
Oä
‰Ñ! !Õ$rKcó¤—|j€ td«‚|jd|jd|jd|jdfS)NzMust set data firstrrÏ)rÂr¸r¨r©r¾s rIr&zNonUniformImage.get_extent|sF€Ø �7‰7ˆ?ÜÐ4Ó5Ð 5Ø�x‰x˜‰{˜DŸH™H R™L¨$¯(©(°1©+°t·x±xÀ±|ÐCÐCrKcó—yrNrrXs rIr¢zNonUniformImage.set_filternorm�ó€Ø rKcó—yrNr)rªr°s rIr£zNonUniformImage.set_filterrad„rÐrKcóR•—|j� td«‚t‰|�
|«y©Nz'Cannot change colors after loading data)rÂr¸rœÚset_norm)rªr­r²s €rIrÔzNonUniformImage.set_norm‡ó&ø€Ø �7‰7Ð ÜÐHÓIÐ IÜ
‰Ñ˜ÕrKcóR•—|j� td«‚t‰|�
|«yrÓ)rÂr¸rœÚset_cmap)rªr¬r²s €rIr×zNonUniformImage.set_cmapŒrÕrKcór—|j|j}}||jdks6||jdkDs$||jdks||jdkDryt j
|j|«dz
}t j
|j|«dz
}|j ||fS©NrrÏr(©ÚxdataÚydatar¨r©r-rªr©rªr”rDrEr™ršs rIr›zNonUniformImage.get_cursor_data‘ó–€à�{‰{˜EŸK™Kˆ1ˆØ
�—‘˜‘ ŠO˜q 4§8¡8¨B¡<Ò/Ø�D—H‘H˜Q‘K’ 1 t§x¡x°¡|Ò#3ØÜ �O‰O˜DŸH™H aÓ (¨1Ñ ,ˆÜ �O‰O˜DŸH™H aÓ (¨1Ñ ,ˆØ�w‰w�q˜!�t‰}ÐrKr_)r·r`rarbr�rr0rBrDr¤r&r¢r£rÔr×r›rfrgs@rIr�r�ïsLø„ñð-6ö .òóH-òTò0:ô
%òDò

ò
ôô
ö
rKr�cóT‡—eZdZdZ d
ddddœˆfd„ Zd d„Zd„Zd„Zd„Zd „Z ˆxZ
S) Ú PcolorImagezÉ
Make a pcolor-style plot with an irregular rectangular grid.
This uses a variation of the original irregular image code,
and it is used by pcolorfast for the corresponding grid type.
N)r¬r­r®c óz•—t‰ |�||||¬«|j|«|�|j|||«yy)aÔ
Parameters
----------
ax : `~matplotlib.axes.Axes`
The Axes the image will belong to.
x, y : 1D array-like, optional
Monotonic arrays of length N+1 and M+1, respectively, specifying
rectangle boundaries. If not given, will default to
``range(N + 1)`` and ``range(M + 1)``, respectively.
A : array-like
The data to be color-coded. The interpretation depends on the
shape:
- (M, N) `~numpy.ndarray` or masked array: values to be colormapped
- (M, N, 3): RGB array
- (M, N, 4): RGBA array
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
The Colormap instance or registered colormap name used to map
scalar data to colors.
norm : str or `~matplotlib.colors.Normalize`
Maps luminance to 0-1.
**kwargs : `~matplotlib.artist.Artist` properties
)r­r¬r®N)rœr�r©rB)
rªr«rDrEr‘r¬r­r®r±r²s
€rIr�zPcolorImage.__init__¤sDø€ôD ‰Ñ˜ $¨T¸YÐÔGØ ×јfÔ%Ø ˆ=Ø �M‰M˜!˜Q Õ "ð rKcó’—|j€ td«‚|r td«‚|j€;|j |jd¬«}t j |gd¢d«|_|j}tj|jjj«d«}t j|«dzjt
j«}|d |k7j«r|x|dd
gdd…f<|dd…dd
gf<|jjj \}}} }
t#| «d zt#|«d z
z
} t#|
«d zt#|«d z
z
} t#| |z«} t#| |z«} |jj$}
t j&|
j(|
j*| «}t j&|
j,|
j.| «}|j0j3|«}|j4j3|«}|j7t
j8«j;«t
j<j?||j@d z|«j7t
j«jC| | d
f«}|||tE«fS)NrÁz&unsampled not supported on PColorImageTr¡)©r(r(rã©rrÚconstantrr�rärÏr�r(r%)#rÂr¸rÝr¨rñr-Úpadrår§ÚpatchÚ
get_facecolorr{rãr/ÚallrGr¥r\ÚviewLimr§r:rpr;rqr¨rªr©r¬r­r®r¯r°r3r±r)rªr>r?rûr‘Úpadded_AÚbgr^r_r\rr8r7Úvlr¶r·rºr»r!s rIr0zPcolorImage.make_imageËs-€à �7‰7ˆ?ÜÐCÓDÐ DÙ ÜÐEÓFÐ Fà �=‰=Ð Ø— ‘ ˜TŸW™W¨D� Ó1ˆAÜŸF™F 1Ò&>À
ÓKˆDŒMØ—=‘=ˆÜ
�_‰_˜TŸY™YŸ_™_×:Ñ:Ó<¸aÓ
@ˆÜ�h‰h�r‹l˜SÑ ×
(Ñ
(¬¯©Ó
2ˆØ �T‰N˜bÑ × %Ñ %Ô 'Ø:<Ð <ˆH�a˜�Wša�ZÑ  8ªA°°2¨w¨JÑ#7à—Y‘Y—^‘^×+Ñ+‰
ˆˆ1ˆa�Ü�q“˜C‘¤E¨!£H¨s¡NÑ3ˆÜ˜“(˜S‘.¤U¨1£X°¡^Ñ4ˆÜ�e˜mÑ+Ó,ˆÜ�v 
Ñ-Ó.ˆØ
�Y‰Y×
Ñ
ˆä— ‘ ˜BŸE™E 2§5¡5¨%Ó0ˆÜ— ‘ ˜BŸE™E 2§5¡5¨&Ó1ˆØ—‘×%Ñ% eÓ,ˆØ—‘×%Ñ% eÓ,ˆà �M‰Mœ"Ÿ)™)Ó $× *Ñ *Ó ,Ü—‘— ‘ ˜U X§^¡^°AÑ%6Ñ6¸Ó>ñ
@ç
‰T”"—(‘(‹^ŸG™G V¨U°AÐ$6Ó7ð ð�1�aÔ*Ó,Ð,Ð,rKcó—y)NFrr¾s rIrz"PcolorImage._check_unsampled_imageìs€ØrKcóò—|j|«}|€&tjd|jddz«n'tj|t
«j
«}|€&tjd|jddz«n'tj|t
«j
«}|jdd|jdz
|jdz
fk7r;td|jdd›d|jdz
|jdz
f›d�«‚|d |dkr|ddd …}|dd…ddd …f}|d |dkr|ddd …}|ddd …}||_ ||_
||_ d|_ d
|_
y) az
Set the grid for the rectangle boundaries, and the data values.
Parameters
----------
x, y : 1D array-like, optional
Monotonic arrays of length N+1 and M+1, respectively, specifying
rectangle boundaries. If not given, will default to
``range(N + 1)`` and ``range(M + 1)``, respectively.
A : array-like
The data to be color-coded. The interpretation depends on the
shape:
- (M, N) `~numpy.ndarray` or masked array: values to be colormapped
- (M, N, 3): RGB array
- (M, N, 4): RGBA array
NrÐr(rrtz"Axes don't match array shape. Got z , expected ú.rÏT)r>r-Úaranger3r{r6r®rVrÝrÂr¨r©r¨rrÇs rIrBzPcolorImage.set_dataïsX€ð$
× 'Ñ '¨Ó *ˆØ-.¨YŒB�I‰I�b˜!Ÿ'™' !™* q™.Ô )¼B¿H¹HÀQÌÓ<N×<TÑ<TÓ<VˆØ-.¨YŒB�I‰I�b˜!Ÿ'™' !™* q™.Ô )¼B¿H¹HÀQÌÓ<N×<TÑ<TÓ<VˆØ �7‰7�2�Aˆ;˜1Ÿ6™6 A™: q§v¡v°¡zÐ2Ò 2Ýà—‘˜˜!’˜qŸv™v¨™z¨1¯6©6°A©:Ò6ð8ó9ð
9ð
ˆR‰5�1�Q‘4Š<Ø‘$�B�$‘ˆAØ’!‘T�r�T�'‘
ˆAØ ˆR‰5�1�Q‘4Š<Ø‘$�B�$‘ˆAØ‘$�B�$‘ˆA؈ŒØˆŒØˆŒØˆŒ
؈�
rKcó—td«‚rÉrrÊs rIrDzPcolorImage.set_arrayrÌrKcór—|j|j}}||jdks6||jdkDs$||jdks||jdkDryt j
|j|«dz
}t j
|j|«dz
}|j ||fSrÙrÚrÝs rIr›zPcolorImage.get_cursor_datarÞrK)NNNr_) r·r`rarbr�r0rrBrDr›rfrgs@rIràràœsDø„ñðØØð%#ð
ØØö%#óN-òBò$òL:örKràcóR‡—eZdZdZdZdZdddddddœˆfd„
Zd„Zd
d„Zˆfd „Z ˆxZ
S) Ú FigureImagezAn image attached to a figure.rrN)r¬r­r®ÚoffsetxÚoffsetyr›c 󜕗t‰ |�d||||¬«|j|«||_||_|j |«d|_y)ú´
cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1
kwargs are an optional list of Artist keyword args
N)r­r¬r®r›r�)rœr�Ú
set_figureÚoxÚoyr©r?)
rªÚfigr¬r­r®rör÷r›r±r²s
€rIr�zFigureImage.__init__*sXø€ô ‰ÑØ ØØØØð ô
ð
�‰˜Ô؈ŒØˆŒØ ×јfÔ%Ø ˆÕrKcó¨—|j«\}}d|jz|dz
|jzd|jz|dz
|jzfS)r‹rŒr�)r¿rûrü)rªr�r�s rIr&zFigureImage.get_extentGsP€àŸ=™=›?ш�Ø�t—w‘w‘ ¨¡ ¨d¯g©gÑ 5Ø�t—w‘w‘ ¨¡ ¨d¯g©gÑ 5ð7ð 7rKc ó—|jd¬«}|j|jz }t|j|z |j|z g|j|z |j
j dz|j|z |j
j dzgg«}|j«\}}||jz}||jz}tddg||gg«} |j|j
||| ||z |d¬«S)NTrtr(rF)r?rûrü) rwÚdpir rûrürÂr3Úget_size_inchesr)
rªr>r?rûrýÚfacrGr8r7r<s
rIr0zFigureImage.make_imageMs€à�o‰o 4ˆoÓ(ˆØ�l‰l˜3Ÿ7™7Ñ"ˆô�d—g‘g˜c‘k 4§7¡7¨3¡;Ð/Ø—w‘w˜s‘{ T§W¡W§]¡]°1Ñ%5Ñ5Ø—g‘g˜c‘k D§G¡G§M¡M°!Ñ$4Ñ4ð7ð8ó9ˆð×+Ñ+Ó-‰
ˆˆvØ
�—‘шØ�(—,‘,шÜ�a˜�V˜e V˜_Ð-Ó.ˆØ×ÑØ �G‰G�T˜4 °]ÀSÑ5Hذuð ó>ð >rKcó2•—t‰|�|«d|_y)zSet the image array.TN)rœrBr)rªr‘r²s €rIrBzFigureImage.set_data_sø€ä
‰Ñ˜Ô؈�
rKr_) r·r`rarbrcrFr�r&r0rBrfrgs@rIrõrõ#s=ø„Ù(à
€Fà€NðØØØØØö!ò:7ó >÷$ðrKrõc óL‡—eZdZdZdddddddddœˆfd„
Zd d„Zd „Zd d
„ZˆxZS)
Ú BboxImagez;The Image class whose size is determined by the given bbox.NTr^F©r¬r­r®r‡r›r¯r°r*c óF•—t‰ |� d|||||||| dœ|
¤Ž||_y)rùNrrN)rœr�rG) rªrGr¬r­r®r‡r›r¯r°r*r±r²s €rIr�zBboxImage.__init__hsEø€ô$ ‰ÑØ ð
àØØØ'ØØ!ØØñ
ðò
ðˆ� rKcóð—|€|j«j«}t|jt«r |jSt |j«r|j|«St
d«‚)NzUnknown type of bbox)rwÚ
_get_rendererrOrGr
ÚcallablerÝ)rªr>s rIrrzBboxImage.get_window_extentˆs\€Ø Ð Ø—‘Ó(×6Ñ6Ó8ˆHä �d—i‘i¤Ô *Ø—9‘9Ð Ü
�d—i‘iÔ
Ø—9‘9˜XÓ&Ð &äÐ3Ó4Ð 4rKcóÄ—|j|«s|j«sdifS|j|j}}|j «j ||«}|ifS)r#F)r$rrDrErrr%)rªr'rDrEr(s rIr%zBboxImage.contains“s[€à × !Ñ ! *Ô -°T×5EÑ5EÔ5Gؘ"�9Ð Ø�|‰|˜ZŸ\™\ˆ1ˆØ×'Ñ'Ó)×2Ñ2°1°aÓ8ˆØ�rˆzÐrKcó:—|j«\}}|j|«j«}|xj||gzc_|j|«}t ddg||gg«}t |«|_|j|j|||||¬«S)Nrr) Úget_canvas_width_heightrrróÚ_pointsr r
Ú
_transformrrÂ) rªr>r?rûr8r7Úbbox_inÚbbox_outr<s rIr0zBboxImage.make_image›sž€à ×8Ñ8Ó:‰
ˆˆvØ×(Ñ(¨Ó2×9Ñ9Ó;ˆØ�Š˜E 6˜?Ñ*�Ø×)Ñ)¨(Ó3ˆÜ�a˜�V˜e V˜_Ð-Ó.ˆÜ)¨$Ó/ˆŒØ×ÑØ �G‰GØ �X˜t ]¸ið óIð IrKrNr_) r·r`rarbr�rrr%r0rfrgs@rIrres6ø„ÙEðØØØ#ØØ ØØöó@ 5ò÷
IrKrcó —ddlm}|€²t|t«rS|j |«}t |j «dkDrd}nxt|«jj«dd}nQt|d«rd}nBt|d«r1t|j«jj«dd}nd}n|}|dk(rtjjntjj }t|t«r2t |j |«j «dkDr t#d«‚||«5}t|tjj«r t%|«n
t'|«cddd«S#1swYyxYw) a

Read an image from a file into an array.
.. note::
This function exists for historical reasons. It is recommended to
use `PIL.Image.open` instead for loading images.