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 ejPd
ejPd ejPd ejRd
ejTdejVdejXdejZdej\dej^dej`dejbdejddejfdejhdejjdejlejnejpejPdœ¥Z9e:e9«Z;d3dZ< d4dZ=dddœdZ>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%Ú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ÚtransÚbboxÚoutputr+s
úS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/image.pyÚcomposite_imagesrJ<ô4 ˆ6ƒ{Üx‰x˜ ¬¯©Ô2°A°qÐ €EØ
€FØòHˆØ,¨X°}Óˆˆa Ñ Ø
Ñ ˆ
Ñ ˆ L‰L˜$  1 e×&=Ñ&=Ó&?Ð M‰MÜq˜!f˜q 4§:¡:¨a¡=Ñ0°!°d·j±jÀ±mÑ2CÐ
Hð
Hô ˆ5ƒzQ‚Üx‰x˜ ¬¯©Ô2°A°qÐ :‰: €Dä
X‰XÜ ˆT[‰[Ó œ3˜tŸz™z›?¨AÐ.´b·h±hô@€Fðˆˆa
×$ Q¨¯©¡[°!°d·g±g±+Óܘ˜f e¬V¯^©^Ø!&¨eö
4—77˜*¨D¯G©G°mÑ,CÐ có¶‡ —td|D««}||nj«}|s|s|D]}|j«ŒygŠj«Š ˆˆ ˆˆfd}|D]l}t |t
«rB|j
«r2|j«r"|j«sj|«Œ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 ¤:×@ùsNcó²t«dk(rdj«n®t«dkDr t«\}}}|jdk7r€‰j «}|j j «|jj««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ÚgcÚ image_groupÚmagÚparentr>s €€€€rIÚ flush_imagesz3_draw_list_compositing_images.<locals>.flush_imagesŒø€Ü 1Ò˜A‘×# HÕ! -¨k¸8ÀSÓI
a˜Ø—9‘9 ’>ØÓ*×)¨&¯+©+Ô×$ V×%9Ñ%9Ó%;Ô׬E°!«H´e¸A³hÀÔ—J‘J”LØšArK)
Ú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_imagesrotû€ôÑ@¸Ô@€Jð,>Ð+IÑ"×ñ™JØò ˆAØ
F‰F ñ ðˆ Ø×÷ ðò !ˆAܘ1œjÔ)¨a¯o©oÔ.?Ø—MM”O¨A¯O©OÔ,=Ø×" Ø ð
 rKr(r)c ó°d}|jddkDr|tj|jd¬««t t j |jddz ««}|dddd|f}t«j|d«|z}|jddkDr|tj|jd ¬««t t j |jddz ««}|dd|ddf}t«jd|«|z}|j«}|d
vr!t jddg|jd|jdgg«} |j| «}
t jt j|
dddf««} t jt j|
dddf««} | 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(iz
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ð ‡zz!}Ü
c—jj ?”2—77˜4Ÿ:™: a™=¨5ÑØ’A‘v˜vI‰ˆÜ“J×$ T¨1Ó-° Ñ9ˆ Ø ‡zz!}Ü
c—jj <”2—77˜4Ÿ:™: a™=¨5ÑØ‘FdFšAI‰ˆÜ“J×$ Q¨Ó-° Ñ9ˆ ð×1€MØÐh‰h˜˜A˜ §¡¨A¡°·
±
¸
Ð >Ð@ˆØ×" 'ˆÜ”r—ww˜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ØÐØ×Ü
‡OOD˜#˜yܘmÑØØ××  €JrKcó tj|jd|jddf|j¬«}||ddddddf<|jtjk(rd|dddddf<|Sd|dddddf<|S) z\
Convert an RGB image to RGBA, as required by the image resample C++
extension.
rr(r%r&Nrséÿçð?)r-r5r3r'r/)Úrgbas rIÚ _rgb_to_rgbar“Ûs~ô
8‰8Q—W‘W˜Q‘Z §¡¨¡¨QÐ/°q·w±wÔ ?€DØ€DŠŠAˆrˆrˆ ‡zz”R—X‘XÒØˆŠQ’1ˆW‰
ð €KðˆŠQ’1ˆW‰
Ø €KrKcóeZdZdZdZ d!ddœˆfd ZdZˆfdZdZd „Z d
Z
d Z ˆfd Z d"d
Z
d#dZdZej"d«ZdZdZed«ZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"d „Z#ˆxZ$S)$rP
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) 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
€rIrz_ImageBase.__init__úø€ô ј×,¨T°4¸Ó ˆ—\‘\ 1ˆFÜ ×јG WÐ-°fÕˆŒ Ø ×јJÔ ×ј9Ô ×ј}Ô ×$Ð%8Ô ×ј(ÔˆŒ àˆŒ
à ×јfÕ%rKcó¢ |j«}t|«jd|dS#t$rt|«jcYSwxYw)Nz(shape=ú))Ú get_shapeÚtypeÚ__name__Ú RuntimeError)r3s rIÚ__str__z_ImageBase.__str__sPð—N$ˆ˜4“j×*¨'°%°¸ <øÜò˜“:×  'ús*-­AÁ
Acó,it|«¥ddi¥S)Nr¨)Ú __getstate__©s €rIz_ImageBase.__getstate__sø€à;”%;¨*°dÑ;rKcó(|j«ddS)z9Return the size of the image as tuple (numrows, numcols).Nrt)©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¸r3s rIz_ImageBase.get_shape&s'ð 7‰7ˆÐ w‰w}‰}ÐrKcó–tjj||«tj|«dvr t d«d|_y)
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+s rIÚ set_alphaz_ImageBase.set_alpha/sAô ×+¨D°%Ô
7‰75> Ñ ð
ˆ
rKcóz|j"tj|j«dkDrdS|jS)
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-s rIr2z_ImageBase._get_scalar_alpha=s5ð—k)¬R¯W©W°T·[±[Ó-AÀAÒ-Eˆsð Øð rKcó0d|_t| «y)zU
Call this whenever the mappable is changed so observers can update.
N)Úchangedr¼s €rIz_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|jd«|j*}|dvrÓt-j.ddg|jd|jdgg«}| j1|«}t-j2t-j4|dddf««|jdz }t-j2t-j4|dddf««|jdz }|d ks|d krd}nd}|j&d k(rt|dk(rn|j6j8dk(rzt-j6|j6j:dkDrdnd«}|j:|j6j:krot=j>d|j6d|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«}|ddddd f}!|!jCt,jT«z|z|!ddn\|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 datarrrrCÚfr%Úf8Úf4zCasting input data from z to z for imshow.g„×—AT)r*r).rs.F©Úbytesr­)>r¸rVr Ú intersectionr8r7rr r9r3ryrr:r;Ú
get_transformÚ is_affineÚmathrxr6Ú
ValueErrorÚ_interpolation_stager-r{r|r}r~r'ÚkindÚitemsizerÚ
warn_externalÚmaxÚastypeÚminrrOr­ÚmcolorsÚNoNormÚmaskÚwhereÚfloat32ÚnanÚ ones_likeÚisnanÚ get_alphaÚmaÚ masked_arrayÚautoscale_NoneÚto_rgbar/r“r2rÚ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Ú scaled_dtypeÚdaÚ A_resampledrçÚ out_alphaÚout_maskr+Úresampled_maskedrHÚ output_alphaÚ
alpha_channelÚsubsets# rIÚ _make_imagez_ImageBase._make_imageQð\
ˆð
6‰6QŠ;Üð
×°9Ó à Ð Ø+¨mÑ;ˆØ&×
Ñ=ˆà ˜  /°QÒ"6Ø ;‰;˜ ×% a¨!¯'©'°!©*¨Ó5×;¸A¸B‰Bä$ˆ
Ü 
‰UØ
 §¡¨¡
Ñ §¡¨¡Ñ‰Yw—zz 7§:¡:Ó
× Ñ Ó 
 $ˆðÜ
ߘLŸO™OÐ+¨l¯o©oÐ-=Óñ § ¢ Ñ0EØ #ÑÒÀ#Ñ0EÈÒ0LÜŸ ™  .Ó1ˆIÜŸ ?Ó3ˆJØ$ 5¸ÑGˆÑ8¸Kˆ
×!  Ñ"3°S¸<Ñ5GÓ H‰Aä˜+ˆIܘ_Ó-ˆJØ Ð+ˆ âØ—F‘F˜a’K 1§6¡6¨Q¢;°1·7±7¸2±;À&Ñ3HÜ  >°!·'±'°¸/Ð!JÓ#'×";Ñ";Ð Ø"Ð&=Ñ—hh  A ¨¯©°©°Q·W±W¸Q±ZÐ(@ÐBØ—{{ 'ÜŸœrŸw™w tªA¨q¨D¡zÓ3°a·g±g¸a±jÑ@ÜŸœrŸw™w tªA¨q¨D¡zÓ3°a·g±g¸a±jÑ@ؘAI 5¨1¢9Ø*0Ñ'à*0Ðv‰v˜2°fÓ —77—<< &Ü#%§8¡8°A·G±G×4DÑ4DÀqÒ4H©DÈdÓ#S#×,¨q¯w©w×/?Ñ/?Ò×*Ð-EÀaÇgÁgÀYØ-1°,°¸,MõNð ŸŸ¨Ó·±³·±¸tÓ0DÑDBØ+-°ª8¡4¸¨a¯h©h°|Ó.DÀiÐQRÓS ô˜dŸi™i¬¯©Ô8Ø"-×"4Ñ"4°Q·W±WÓ"=Ÿ6™6Ÿ<™<¨1¯7©7ÒŸ §¡¬¯©´B·F±FÓ);¼R¿Z¹ZÈ»]ÔŸ\™\¨!¬R¯Z©ZÓô
& d¨D°)¸ÔN ØÜŸ8™8 .Ø&' ˜ŸÓ(ØÐ¯©°«¸!Ò);ؤ¨4°¸ À1ÈtÔ!TÑTIä#%§5¡5×#5Ñ#5°kÀ8Ó#LÐ ØŸÐ#3Ó4’à—6‘6˜Q’;Ø—I‘I×,¨QÔŸ  Q›ŸÓ(Ø—w‘w˜q‘z Q’Ø./¯g©g¼¿¹Ò.A¡sÀs™ ä'0Ø  ! F¡)¨Y¸ó(;˜ äœl¨1¨S°"°1°"¨W©:Ó6¸ À1óF—WW˜U“^ 'ä#,¨T°5¸)ÀQÓ#Gœl¨1¨S°"°1°"¨W©:Ó6¸ À1ó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óFFà!-vð—\\ ¸5Aˆv‰v˜‹{Ø×0Ø &¢qª!¨Q 
௩Ó4°yÑ@À5Ñ™aÒ ð}‰}Ð$Ø $§ ¡ ¨Q°dÀ!Ç&Á&ÈAÁ+  Ó O
Ø—]‘]ˆFô% Y°· ± ³
ÓGˆFØÜ”C˜Ÿ  QÓ”C˜Ÿ  a™¨¯©°a©Ó”C˜Ÿ  QÓ”C˜Ÿ  a™¨¯©°a©Ó<ˆ 
×”C˜Ÿ  (¬#¬c°&·+±+¸qÓ.AÓ*BóDØFGñHˆAð|—¨ ¯©¸Ð:rKcótd«)
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?s rIr0z_ImageBase.make_image-sô$"Ð"LÓMrKcóy)z|
Return whether the image is better to be drawn unsampled.
The derived class needs to override it.
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)NFrr()Ú get_visibleÚstaleÚ get_arrayrVrWÚ _set_gc_cliprÉr2Úset_urlÚget_urlÚset_gidÚget_gidÚoption_scale_imagerr0r ryr3r[rgr])r>r`Úimr^r_rFs rIrUz_ImageBase.drawIsað×ÑÔˆDŒJØ à >‰>Ó × Ñ   ˆDŒJØ à
_‰_Ó
ˆØ ×ј"ÔØ

4—<<“>Ô
4—<<“>Ô × ××(×"Ÿo™o¨hÀ$˜G‰OˆB1ˆ~Ü
ׯ©°!©°b·h±h¸q±kÓBÀUÑJØ×# ¨1¨b°%Õ"Ÿo™oؘ(×>‰OˆB1ˆ×# B¨¨1¨bÔ
Œ ؈
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|rDrEÚ
get_extent)
Ú
mouseeventrFrDrEÚinsides
rIr%z_ImageBase.containshà × "  —yy×)¨*Ó5°aÒ˜" ð
×$×/ˆØ 
§ ¡ ¨j¯l©lÐ<‰ˆˆ1Ø!%§¡Ó!2шˆdD˜$à˜4E ¡X°!°d±(Ñ$;¸qÑ$@òEؘtEØ)*¨T©°a¸$±hÑ(?À1Ñ(Dð àrˆrKcóâ|j|jdk(r|jdddn |jdd¬«}tjj |«j
|d¬«y)z$Write the image to png file *fname*.r™NrÏTr×Úpng)rw)rÚPILÚImageÚ fromarrayÚsave)Úfnamer!s rIÚ write_pngz_ImageBase.write_pngzs[à
\‰\¨4¯;©;¸'Ò+A˜$Ÿ'™'¡$ B $š-ÀtÇwÁwØ $¨4ðóä ‰ ×јBÓ×$ U°5Ð9rKcótj|d¬«}|jtjk7r>tj
|jt d«std|jd«|jdk(r#|jddk(r|jd«}|jd k(s9|jdk(r|jdd
vstd |jd «|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(rtrrzClipping 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Èr3ÚsqueezeÚ
issubdtypeÚintegerräÚ_logÚwarningÚcliprã)rÚhighs rIÚ_normalize_image_arrayz!_ImageBase._normalize_image_array€stô
× % a¨dÔ Ø 7‰7”b—h‘hÒ ¤r§{¡{°1·7±7¼EÀ;Ô'OÜÐ2°1·7±7°)ð<1ð
6‰6QŠ;˜1Ÿ7™7 2™;¨!Ò ˜"“
ˆAؘ!’ ˜qŸv™v¨š{¨q¯w©w°r©{¸fÑ/Dܘn¨Q¯W©W¨I°_Ð 6‰6Q
Ÿ-™-¨¯©´·±Ô<‘3À!ˆDØu‰uw˜Š{˜d Q§U¡U£WšnÜ ð—E‘E“G˜QŸU™U›Wô ô —GG˜A˜q 'àw‰wœ"Ÿ(™(Ò"¤r§}¡}°Q·W±W¼b¿j¹jÔ'IØ—HHœRŸX™XÓ&؈rKcóªt|tjj«r t|«}|j |«|_d|_d|_y)
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©rs rIÚset_dataz_ImageBase.set_data¡s?ô ŸŸÔ ˜Q“ˆAØ×-¨aӌ؈Œ
؈
rKcó&|j|«y)
Retained for backwards compatibility - use set_data instead.
Parameters
----------
A : array-like
N)rBrAs rIÚ set_arrayz_ImageBase.set_array±sð
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)Ú
_val_or_rcr™rÚinterpolations_namesrFr©Úss rIz_ImageBase.set_interpolationÈs>ô
N‰N˜ 4× Ü ×ÑÔ/¸qÕˆÔØˆ
rKcó|jS)zy
Return when interpolation happens during the transform to RGBA.
One of 'data', 'rgba', 'auto'.
)s rIÚget_interpolation_stagez"_ImageBase.get_interpolation_stageÜsð ×(rKcó~tj|d«}tjgd¢|¬«||_d|_y)
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)rCrr)rLTN)rIrrrKs rIz"_ImageBase.set_interpolation_stageäs5ô
N‰N˜1Ð Ü ×ÑÒ3°qÕ9Ø$%ˆÔˆ
rKcóx|j«}|jdk7xr|jxr |jS)z>Return whether the image can be composited with its neighbors.r)rFÚ is_separable)rFs rIrhz_ImageBase.can_compositeõs=à×$ˆà × Ñ   
Ø O‰Oò
à × Ñ ð rKcóLtj|d«}||_d|_y)
Set whether image resampling is used.
Parameters
----------
v : bool or None
If None, use :rc:`image.resample`.
zimage.resampleTN)rIrr)Úvs rIz_ImageBase.set_resampleýs#ô
N‰N˜1Р؈ŒØˆ
rKcó|jS)z(Return whether image resampling is used.)rs rIrz_ImageBase.get_resample
s à~‰~ÐrKcó2t|«|_d|_y)
Set whether the resize filter normalizes the weights.
See help for `~.Axes.imshow`.
Parameters
----------
filternorm : bool
TN)ÚboolÚ _filternormr©s rIz_ImageBase.set_filternormsô  
Ó+ˆÔ؈
rKcó|jS)z8Return whether the resize filter normalizes the weights.)rWs rIrz_ImageBase.get_filternormsà×ÑÐrKcóVt|«}|dkr td«||_d|_y)
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)r6Ú
_filterradr)Úrs rIz_ImageBase.set_filterrads/ô
 ˆØ Š6ÜÐ ˆŒØˆ
rKcó|jS)zReturn the filterrad setting.)r[s rIrz_ImageBase.get_filterrad.s àÐrK)NNNNNTç@F)rFT©rF)%r·Ú
__module__Ú __qualname__Ú__doc__Úzorderrr¿r2rr0rÚallow_rasterizationrUr%r0Ú staticmethodr>rBrDrzrNrhrrrÚ
__classcell__©s@rIrPrPéø„ñ
ð€FðØØØØ ØØð&*ö&ò:ò ò ôðJMØ;?óZ;óxNò(ð
× Ñ ñóò<ò$ ñóðò@ò
ò ò(ò" ò òò ò ò
örKrPc óbeZdZdZdddddddddddœ
ˆfd
ZddZdd „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Úextentr¯r*r•c
óH||_t
||f||||||| |
| dœ | ¤Žy)N) r¬r­r‡rr*r•)Ú_extentrœr)r­r‡rrjr*r•s €rIrzAxesImage.__init__csFø€ðˆŒ ä
ÑØ ð
àØØØØØØ 3ñ
ðó
rKcó”|j\}}}}tj||||g«}|j|j ««SrN)rlr Ú from_extentsÚ transformedrÚ)r>r:Úx1r;Úy1rGs rIÚget_window_extentzAxesImage.get_window_extentsFØŸˆˆB× Ñ  " b¨"¨bÐ!1Ó2ˆØ×Ñ × 2Ñ 2Ó 4Ó5rKcó–|j«}|j«\}}}}ttj||g||gg««} t | |«}
|j
«r(|j«xs2|jjn|jd¬«j} |j|j| |
| ||¬«S)NT©Úrootr)
r&r r-r{rriÚ get_clip_boxr§rGÚ
get_figurer) r>r?rFrpÚx2rqÚy2rGÚtransformed_bboxr<s rIr0zAxesImage.make_image‡à×$ˆàŸÓ*‰ˆˆB”B—H‘H˜r 2˜h¨¨R¨ÐÜ*¨4°ÓØ;?×;KÑ;KÔ;Mׯ © ¯ªØ—_‘_¨$
à×Ñ §¡¨Ð/?ÀØ -¸ð óDð DrKcó(|j«dk(S)z9Return whether the image would be better drawn unsampled.r)rzs rIrz AxesImage._check_unsampled_image“sà×'¨6Ñ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)Ú_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)rjÚcornerss rIr}zAxesImage.set_extent—ð*&*§Y¡Y×%AÑ%AØF˜1I˜v a™yÐ
F˜1I˜v a™yÐ

ó&Ñ"‰ ˆˆtlt˜ Ü×" Ó y‰y× $×'ˆày‰y× $×'ˆày‰y× $×'ˆày‰y× $×à˜˜d DÐàˆŒ ؘ t  ÐØ × Ñ  Ô)Ø"&¨ ˆ×Ñ×Ñ™AÐØ"&¨ ˆ×Ñ×Ñ™AÐØ 9‰9× I‰I× Ñ   d˜|°$Ð Ô 9‰9× I‰I× Ñ   d˜|°$Ð Ô ˆ
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)ÚszÚnumrowsÚnumcolss rIr&zAxesImage.get_extentÇseà <‰<Ð —< àˆBØ ˆG{‰{˜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)
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&rrr r3r r|rDrErer-r6)
ÚeventröÚarrÚ data_extentÚ array_extentrFÚpointÚis
rIÚget_cursor_datazAxesImage.get_cursor_dataÓs*ð"&§¡Ó!2шˆdD˜ ;‰;˜ ˜t$ˆn‰nӈܘT 4˜L¨4°¨,Рܘa ˜V c§i¡i°¡l°C·I±I¸a±LÐ%AÐCˆ Ø×$×/ˆØ
 [¸ÔØ §¡¨%¯'©'Ð 2Ó3ˆÜ Œrx‰x˜Ô ØØ|‰|œCÓˆˆ1àŸ 1™Ôð01°AÔ/D¸¿ ¹ À!¹ Ò/DØð0EØàq˜!t rKrNr_) r`rarbrrrr0rr}r&rrfrgs@rIriri3sNø„ñ-ðbØØØØØ ØØØ%)ö
ó>
Dò.ò`
rKricóxeZdZdZddœˆfd
ZdZddZdZdZˆfd „Z d
Z
d Z d Z ˆfd
Z
ˆfdZdZˆ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 óHt||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‡s €rIrzNonUniformImage.__init__ùs%ø€ô јÑ&˜ ×ј-rKcóy)z)Return False. Do not use unsampled image.Frs rIrz&NonUniformImage._check_unsampled_imagesàrKcóŒ |j td«|r td«|j}|jdk(rm|jt
j k7r|j|d¬«}nçt j|ddddt
jfdd«}d|dddddf<n«|jt
j k7r"d|zjt
j «}|jddk(rZt jtg|jd d¢d«t
j «}||ddddd df<d|dddddf<|}|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}
«ddd f}| j+t j,|| | «Dcgc]}||fŒc}«ddd 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}|dddd|fjCd
«}|||z}||||jd d|zz
}|||d d|zz
}||||jd d zd|zz
}||dddd|f<Œz|||tS«fScc}
wcc}w)NrÁz*unsampled not supported on NonUniformImagertr%rrsrrr(rr&)*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.Úranger) 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ˆ?ÜÐ ÜÐ G‰GˆØ 6‰6QŠ;Øw‰wœ"Ÿ(™(Ò—LL ¨$/‘ä—I‘I˜a¢¢1¤b§j¡jÐ 0Ñ1°1°aÓ8Ø !Q˜'
àw‰wœ"Ÿ(™(Ò˜U—NN¤2§8¡8Ó,Øw‰wq‰z˜Ü—HHœUÐ#5 Q§W¡W¨Q¨q \Ð#5°1Ð#5Ó¿¹ÓAØ ’!’Q˜˜!˜)‘ Ø !Q˜'
ØØ—Y‘Y—^‘^×+‰
ˆˆ1ˆaÜ”e˜A“h ‘n¬¨q«°C©Ñ8¸MÑÜ”u˜Q“x #‘~¬%°«(°S©.Ñ9¸]Ñà ŸI™IרŸ[™[¨¨A¨uÓ ˆaŠVÒ 8Ú89¸1¸ñàŸ[™[¨¨A¨vÓ ˆaŠVÒ 9Ú9:¸A¸ñð × Ñ  )Ó —XX˜c˜r] T§X¡X¨a¨b 1°QÑ6ˆ—XX˜c˜r] T§X¡X¨a¨b 1°QÑ6ˆ×& -ˆ×& -ˆ
×$ '×,¬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ä—ff—ll 5¨1¯7©7°1©:Ñ#5°uÓ=ˆ—W‘WÜ— ‘ ˜% $§(¡(¨5¡/Ñ1´2·7±7¸4¿8¹8Ó3DÀUÑ3KÜ "§
¡
ôˆFô—W‘WÜ— ‘ ˜% $§(¡(¨5¡/Ñ1´2·7±7¸4¿8¹8Ó3DÀUÑ3KÜ "§
¡
ôˆFô—(‘(˜1˜v™: q¨6¡zÓ2ˆ—((˜6 1 v¡:Ó.ˆ—((˜1˜v™: vÓ.ˆCÜ—(‘(˜6 6Ó*ˆCܘ6 5¨!Ð,¬b¯h©hÓ7ˆBܘa›ò
%Ø’qš!˜Tz‘]×*¨2Ó.ð˜B˜w™KÑ'Øs˜R §¡¨¡
  ˜_¨WÑ5Øs˜ ˜V G™_Ñ,Øs˜R §¡¨¡
¨Q¡ ÐÑ9Ø!$’1’a˜:ð
1,ùò[
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)
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{r3r©rDrErs rIrBzNonUniformImage.set_dataUs­ð
× Ó *ˆÜ H‰HŸ
Ó #ˆÜ H‰HŸ
Ó #ˆØ˜!Ÿ&™&Ô% Ð +,¯'©'°"°1¨+¸¿¹À1Ç7Á7Ñ9JÒ*JÜÐ ˆŒØˆŒØˆŒØˆŒ
؈
rKcótd«©NzMethod not supportedr©Úargss rIrDzNonUniformImage.set_arraymóÜ!Ð"8Ó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)r)rLs €rIz!NonUniformImage.set_interpolationps4ø€ð
ˆ=˜QÐ&=Ñ'NóOð
Oä
Ñ! $rKcó¤|j td«|jd|jd|jd|jdfS)NzMust set data firstr)r¸s rIr&zNonUniformImage.get_extent|sFØ 7‰7ˆÐ x‰x˜‰{˜DŸH™H R™L¨$¯(©(°1©+°t·x±xÀ±|ÐCrKcóyrNrrXs rIzNonUniformImage.set_filternormóØ rKcóyrNr)s rIzNonUniformImage.set_filterrad„rKcóR|j td«t|
|«y©Nz'Cannot change colors after loading data)r¸Úset_norm)r­s €rIzNonUniformImage.set_norm‡ó&ø€Ø 7‰7Ð ÜÐ 
јÕrKcóR|j td«t|
|«y)r¸Úset_cmap)s €rIr×zNonUniformImage.set_cmapŒrKcór|j|j}}||jdks6||jdkDs$||jdks||jdkDryt j
|j|«dz
}t j
|j|«dz
}|j ||fS©Nrr(©ÚxdataÚydatar¨r-©r”rDrEr™s rIrzNonUniformImage.get_cursor_dataó–à{‰{˜EŸK™Kˆ1ˆØ
˜ ŠO˜q 4§8¡8¨B¡<ÒD—HH˜QK 1 t§x¡x°¡|Ò#3ØÜ O‰O˜DŸH™H aÓ (¨1Ñ ,ˆÜ O‰O˜DŸH™H aÓ (¨1Ñ ,ˆØw‰wq˜!t‰}ÐrKr_)r`rarbrrr0rBrDr&r×rrfrgs@rIrrïsLø„ñð-6ö óH-òTò0
Dò

ò
ôô
ö
rKrcóTeZdZdZ d
ddddœˆfd Zd dZdZdZdZd „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­c ózt‰ |||||¬«|j|«||j|||«yy)
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­N)rrB)
rDrErr­s
€rIrzPcolorImage.__init__¤sDø€ôD ј $¨T¸YÐÔ ×ј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
gddf<|dddd
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(©rrÚconstantrrrr(r%)#rÂr¸r-ÚpadråÚpatchÚ
get_facecolorr{r/ÚallrGr\ÚviewLimr§r:rpr;rqr­r3r)r>r?rÚpadded_AÚbgr^r_r\rr8r7Úvlr¶r!s rIr0zPcolorImage.make_imageËs-à 7‰7ˆ?ÜÐ ÜÐ =‰=Ð Ø ˜TŸW™W¨D Ó1ˆŸF™F 1Ò&>À
ÓKˆDŒMØ—==ˆÜ
_‰_˜TŸY™YŸ_™_×<¸
Üh‰hr‹l˜SÑ ×
¯©Ó
Ø T‰N˜ × 'Ø:<Ð <ˆHa˜Wša  8ªA°°2¨w¨JÑ#7à—Y‘Y—^‘^×+‰
ˆˆ1ˆaÜq“˜C‘¤E¨!£H¨s¡NÑܘ“(˜S‘.¤U¨1£X°¡^ÑÜe˜mÑÜ
Ñ.ˆØ
Y‰Y×
Ñ
ˆä ˜BŸE™E 2§5¡5¨%ÓÜ ˜BŸE™E 2§5¡5¨&Ó1ˆØ×% eÓØ×% à M‰Mœ"Ÿ)™)Ó  ˜U X§^¡^°AÑ%6Ñ6¸Ó
@ç
‰T”"—((^ŸG™G V¨U°AÐ$6Ó ð1,rKcóy)NFrs 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|jddd|jdz
|jdz
fd«|d |dkr|ddd …}|ddddd …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{r6rVrs rIrBzPcolorImage.set_dataïsXð$
× Ó *ˆØ-.¨YŒBI‰Ib˜!Ÿ'™' !™* q™.Ô )¼B¿H¹HÀQÌÓ<N×<TÑ<TÓ<VˆØ-.¨YŒBI‰Ib˜!Ÿ'™' !™* q™.Ô )¼B¿H¹HÀQÌÓ<N×<TÑ<TÓ<VˆØ 7‰72Aˆ;˜1Ÿ6™6 A™: q§v¡v°¡zÐ à˜˜!’˜qŸv™v¨™z¨1¯6©6°A©:Ò

ˆR‰51Q4Š<Ø$B$ˆ!TrT'
ˆ ˆR‰51Q4Š<Ø$B$ˆ‘$B$‘ˆA؈ŒØˆŒØˆŒØˆŒ
؈
rKcótd«rs rIrDzPcolorImage.set_arrayrKcór|j|j}}||jdks6||jdkDs$||jdks||jdkDryt j
|j|«dz
}t j
|j|«dz
}|j ||fSs rIrzPcolorImage.get_cursor_datarK)NNNr_) r`rarbrr0rrBrDrrfrgs@rIœsDø„ñðØØð%
ØØö%#óN-òBò$òLrKcóReZdZdZdZdZdddddddœˆfd
ZdZd
dZˆfd „Z ˆxZ
S) Ú FigureImagezAn image attached to a figure.rrN)r­ÚoffsetxÚoffsetyrc óœ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­rr)rÚ
set_figureÚoxÚoyr©r?)
Úfigr¬r­rs
€rIrzFigureImage.__init__*sXø€ô ÑØ ØØØØð ô
ð
˜Ô؈ŒØˆŒØ ×јfÔ ˆÕrKcó¨|j«\}}d|jz|dz
|jzd|jz|dz
|jzfS)rr)r¿)rrs rIr&zFigureImage.get_extentGsPàŸ=™=›?шØt—w‘w‘ ¨¡ ¨d¯g©gÑ 5Øt—w‘w‘ ¨¡ ¨d¯g©gÑ 5ð 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?) rwÚdpir r3Úget_size_inchesr)
r>r?ÚfacrGr8r7r<s
rIr0zFigureImage.make_imageMsào‰o 4ˆ(ˆØl‰l˜3Ÿ7™7Ñ"ˆôd—gg˜ck 4§7¡7¨3¡;Зww˜s{ T§W¡W§]¡]°1Ñ%5Ñ—gg˜ck D§G¡G§M¡M°!Ñ$4Ñð×-‰
ˆˆ
шØ(—,‘,шÜV˜e V˜_ÐØ×ÑØ G‰GT˜4 °]ÀSÑ5Hذuð ó >rKcó2t||«d|_y)zSet the image array.TN)rBr)rs €rIrBzFigureImage.set_data_sø€ä
Ñ˜ÔØˆ
rKr_) r`rarbrcrFrr&r0rBrfrgs@rI#s=ø„Ù
€Fà€NðØØØØØö!ò: >÷$ðrKc óLeZdZdZdddddddddœˆfd
Zd dZd „Zd d
ZˆxZS)
Ú BboxImagez;The Image class whose size is determined by the given bbox.NTr^r­r‡rr*c óFt | d|||||||| dœ|
¤Ž||_y)NrrN)rrG) rGr­r‡rr*s €rIrzBboxImage.__init__hsEø€ô$ ÑØ ð
àØØØØØñ
ðò
ðˆ rKcóð||j«j«}t|jt«r |jSt |j«r|j|«St
d«)NzUnknown type of bbox)rwÚ
_get_rendererrOrGr
ÚcallablerÝ)r>s rIrrzBboxImage.get_window_extentˆs\Ø Ð ØÓ8ˆHä d—i‘i¤Ô —9‘9Ð Ü
d—i
Ø—99˜ Ð 4rKcóÄ|j|«s|j«sdifS|j|j}}|j «j ||«}|ifS)r#F)r$rrDrErrr%)r'rDrEr(s rIr%zBboxImage.contains“s[à × !  -°T×5EÑ5EÔ5Gؘ" Ø|‰|˜ZŸ\™\ˆ1ˆØ×)×2°1°aÓ8ˆØrˆrKcó:|j«\}}|j|«j«}|xj||gzc_|j|«}t ddg||gg«}t |«|_|j|j|||||¬«S)Nrr) Úget_canvas_width_heightrrÚ_pointsr r
Ú
_transformr) rªr>r?r8r7Úbbox_inÚbbox_outr<s rIr0zBboxImage.make_imageà ×:‰
ˆˆvØ×ÓØŠ˜E 6˜?Ñ*Ø×)¨(ÓÜV˜e V˜_ÐÜ)¨$ÓŒØ×ÑØ G‰GØ X˜t ]¸ óIð IrKrNr_) r·r`rarbrrrr%r0rfrgs@rIrres6ø„ÙØØØØ ØØöó@ ÷
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.