Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/matplotlib/__pycache__/image.cpython-37.pyc

609 lines
42 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]{<7B><00>@s<>dZddlmZddlmZddlZddlZddlmZddl Z
ddl Z ddl mZddlmZddlmZddlmZddlmZddlmZddlmZddlTdd lmZmZm Z m!Z!m"Z"m#Z#e<06>$e%<25>Z&ej'ej'ej(ej)ej*ej+ej,ej-ej.ej/ej0ej1ej2ej3ej4ej5ej6ej7d
<EFBFBD>Z8e9e8<65>Z:d*d d <0A>Z;d+dd<0F>Z<dd<11>Z=Gdd<13>dej>ej?<3F>Z@Gdd<15>de@<40>ZAGdd<17>deA<65>ZBGdd<19>deA<65>ZCGdd<1B>de@<40>ZDGdd<1D>de@<40>ZEd,dd<1F>ZFd-d!d"<22>ZGd#d$<24>ZHd.d(d)<29>ZIdS)/zR
The image module supports basic image loading, rescaling and display
operations.
<EFBFBD>)<01>BytesIO)<01>ceilN)<01>Path)<01>rcParams)<01>FigureCanvasBase)<01>*)<06>Affine2D<32>BboxBase<73>Bbox<6F> BboxTransform<72>IdentityTransform<72>TransformedBbox)<12>none<6E>nearest<73>bilinearZbicubicZspline16Zspline36ZhanningZhammingZhermiteZkaiserZquadricZcatromZgaussianZbesselZmitchellZsincZlanczosZblackman<61><00>?c CsZt|<00>dkr"tjdtjd<03>ddfSg}g}x<>|D]x}|<05>||<02>\}}}} |dk r0||9}||9}|<03>||||<05><06>ptdf<04>|<04>t||g||jd||jdgg<02><01>q0Wt|<03>dkr<>tjdtjd<03>ddfSt<07> |<04>}
tj
t |
j <0C>t |
j <0A>dftjd<03>} xH|D]@\}}}} t<0E><00>||
j||
j<00>} tj|| | tjd| d <09><00>qW| |
j||
j|fS)
aD
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 instance
magnification : float
The additional magnification to apply for the renderer in use.
Returns
-------
tuple : image, offset_x, offset_y
Returns the tuple:
- image: A numpy array of the same type as the input images.
- offset_x, offset_y: The offset of the image (left, bottom)
in the output figure.
r)rr<00>)<01>dtypeNg<00>?<3F>rF)<02>resample<6C>alpha)<15>len<65>np<6E>empty<74>uint8<74>
make_image<EFBFBD>append<6E> get_alphar
<00>shape<70>union<6F>zeros<6F>int<6E>height<68>widthr<00> translate<74>x0<78>y0<79>_imager<00>NEAREST) Zimages<65>renderer<65> magnification<6F>partsZbboxes<65>image<67>data<74>x<>y<>trans<6E>bbox<6F>outputr<00>r3<00>8/tmp/pip-install-i8dhxrtk/matplotlib/matplotlib/image.py<70>composite_images;s, 
. 
r5cs<>tdd<02>|D<00><01>}|dk r|n<06><03><01>}|s.|sHxx|D]}|<06><02><03>q4Wn`g<00><00><03><03><00><01><00><01><02>fdd<05>}x:|D]2}t|t<05>r<>|<06><06>r<><72><00>|<06>ql|<07>|<06><02><03>qlW|<07>dS)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.
css|]}t|t<01>VqdS)N)<02>
isinstance<EFBFBD>
_ImageBase)<02>.0r.r3r3r4<00> <genexpr>sz0_draw_list_compositing_images.<locals>.<genexpr>Ncs<>t<00><00>dkr<1C>d<00><01><03>nnt<00><00>dkr<>t<02><00><03><01>\}}}|jdkr<><72><03><04>}|<03><05>j<06>|<03><07><02><08><00><00><03> |t
<EFBFBD> |<01>t
<EFBFBD> |<02>|<00>|<03> <0C><00>dd<00>=dS)Nrr) r<00>drawr5<00>size<7A>new_gcZset_clip_rectangler1Z set_clip_pathZ get_clip_path<74>
draw_imager<00>round<6E>restore)r-<00>l<>b<>gc)<04> image_group<75>mag<61>parentr)r3r4<00> flush_images<65>s  
 z3_draw_list_compositing_images.<locals>.flush_images)<08>anyZoption_image_nocompositer:<00>get_image_magnificationr6r7<00> can_compositer)r)rEZartistsZsuppress_compositeZ
has_imagesZ not_composite<74>arFr3)rCrDrEr)r4<00>_draw_list_compositing_imagesus
 

 rKcCsztj|jd|jddf|jd<04>}||dd<05>dd<05>dd<06>f<|jtjkr`d|dd<05>dd<05>df<nd|dd<05>dd<05>df<|S) z\
Convert an RGB image to RGBA, as required by the image resample C++
extension.
rrr)rN<><00><>g<00>?)rr rrr)<02>A<>rgbar3r3r4<00> _rgb_to_rgba<62>s " rPcs<>eZdZdZdd<03>Zd7dd <09>Z<05>fd
d <0B>Zd d <0A>Zdd<0F>Zdd<11>Z d8dd<14>Z
d9dd<16>Z dd<18>Z dd<1A>Z ejdd<1C><00>Zdd<1E>Zdd <20>Zd!d"<22>Zd#d$<24>Zd%d&<26>Zd'd(<28>Zd)d*<2A>Zd+d,<2C>Zd-d.<2E>Zd/d0<64>Zd1d2<64>Zd3d4<64>Zd5d6<64>Z<1D>ZS):r7rcCsdt|jjj<03>S)NzAxesImage(%g,%g;%gx%g))<04>tuple<6C>axesr1<00>bounds)<01>selfr3r3r4<00>__str__<5F>sz_ImageBase.__str__NT<4E>@Fc
Ksztj<01>|<00>tj<04>|||<02>d|_|dkr2td}||_|<00>|<06>|<00> |<07>|<00>
|<04>|<00> |<08>||_ d|_ |<00>| <09>dS)a<>
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
TNz image.origin)<0F>martist<73>Artist<73>__init__<5F>cm<63>ScalarMappableZ
_mouseoverr<00>origin<69>set_filternorm<72> set_filterrad<61>set_interpolation<6F> set_resamplerR<00>_imcache<68>update)
rT<00>ax<61>cmap<61>norm<72> interpolationr\<00>
filternorm<EFBFBD> filterradr<00>kwargsr3r3r4rY<00>s 



z_ImageBase.__init__cst<00><00><01>}d|d<|S)Nra)<02>super<65> __getstate__)rT<00>state)<01> __class__r3r4rk<00>s
z_ImageBase.__getstate__cCs"|jdkrtd<02><01>|jjdd<03>S)z+Get the numrows, numcols of the input imageNz"You must first set the image array<61>)<03>_A<5F> RuntimeErrorr)rTr3r3r4<00>get_size<7A>s
z_ImageBase.get_sizecCstj<01>||<01>d|_dS)z<>
Set the alpha value used for blending - not supported on all backends.
Parameters
----------
alpha : float
N)rWrX<00> set_alphara)rTrr3r3r4rr<00>sz_ImageBase.set_alphacCsd|_d|_tj<03>|<00>dS)zb
Call this whenever the mappable is changed so observers can
update state
N)ra<00>
_rgbacacherZr[<00>changed)rTr3r3r4rt<00>sz_ImageBase.changed<65><00>?c% Cs|dkrtd<02><01>|jdkr"td<04><01>t<02>||<04>}|dkr:dS|j|} |j|}
| dks^|
dkrbdS|jdkr<>t<07><00>d|j d <00><02>
dd<08>} nt <0B>} | t<07><00>
|j|j d|j|j d<00><02>|j |j <0A>|<00><0E>7} | t<07><00>|j |j <00><02>
||<05>} | j<0F>rh|<07>rh| d d
k<03>s|
d d
k<03>rhtt| <09><01>} tt|
<EFBFBD><01>}| | | }||
|
}| t<07><00>
d |d |<00>7} nt| <09>} t|
<EFBFBD>}|<06>s0|jd k<07>r<>td <0C>|j <09><01><01>|jd k<02>r<>|j}|<01><16>}|<01><17>}|tjjk<08>r<>t<18>d<03>t<18>d<07>}}|jdk<02>r.|j}|jtjtjfk<07>r^|jtjk<03>r&t <20>!d<0F>|j<15><01>tj}n0|<13>"tj<1F>|<12>"tj<1F>}|dk<04>rXtj}ntj}tj#|j |d<11>}||dd<01><|j$<24>%|<01>t<18>|j$j&<26>t<18>|j$j'<27>}|j$j'|d }|tjk<02>r<>dnd}|||}||k<00>r<>d}n
t<18>|<1A>}|||}||k<04>rd}n
t<18>|<1B>}|dk <09>s&|dk <09>r4t<18>(|||<1B>}||8}|<12>"|<14><01>)<29>}|<13>"|<14><01>)<29>}||k<03>rr|||d}|d7}tj*|| f|jd<11>}t+<2B>,||| t-|<00>.<2E>|<00>/<2F>d |<00>0<EFBFBD>|<00>1<EFBFBD><00>~|d8}||k<03>r<>|||d9}||7}t2|j$t3j4<6A><02>r|<1C>"|j<15>}tj#|j tjd<11>}|j5j |j k<02>rLt<18>6|j5t<18>tj7<6A>t<18>d<07><01>|dd<01><n d|dd<01><tj*|| f|jd<11>}t+<2B>,||| t-|<00>.<2E>dd|<00>0<EFBFBD>|<00>1<EFBFBD><00>~t<18>8|<1E>}t<18>9|<1E>}d||<|<00>$tj<19>:||<1E><02>} n<>|j d dk<02>r<>t;|<01>}n |j d dk<03>rtd <0C>|j <09><01><01>tj*|| df|jd<11>} tj*|| f|jd<11>}!|<00><<3C>}"|"dk<08>rBd}"|d}#t+<2B>,|#|!| t-|<00>.<2E>|<00>/<2F>|"|<00>0<EFBFBD>|<00>1<EFBFBD><00>t;|ddd<17>f<00>}t+<2B>,|| | t-|<00>.<2E>|<00>/<2F>|"|<00>0<EFBFBD>|<00>1<EFBFBD><00>|!| d<|j=| ddd<1C>} |jd k<02>r<>|<00><<3C>}"|"dk<08>r<>d}"| dd<01>dd<01>df}#t<18>>t<18>>|#tj<1D>||"tj?<3F>|#dd<01><n<>|j@dk<08>rT|j=|d|jd kd<1C>|_@|j@} tA|| <0B>B<EFBFBD><00>C<EFBFBD><00><02>B<EFBFBD>}$| tt|$jDd<03><02>tt|$jEd| j d<00><02><01>tt|$jFd<03><02>tt|$jGd| j d<00><02><01>f} t<07><00>tt|$jFd<03><02>tt|$jDd<03><02><01>| } | |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.
*A* may be a greyscale image (M, N) with a dtype of float32, float64,
float128, uint16 or uint8, or an (M, N, 4) RGBA image with a dtype of
float32, float64, float128, or uint8.
If *unsampled* is True, the image will not be scaled, but an
appropriate affine transformation will be returned instead.
If *round_to_pixel_border* is 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) 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 : 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.)NrrN<>upperr<00><><EFBFBD><EFBFBD><EFBFBD>g<00>?g)rnrLzInvalid shape {} for image datarn<00>fz5Casting input data from '{0}' to 'float64' for imshowg<00>חA)rg<00>cAg<00><>@g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?TrLr).rL.F)<02>bytesre)Hrpr;r
<00> intersectionr#r"r\rr$r<00>scaler r%r&<00> get_transform<72> is_affiner!r<00>ndim<69>
ValueError<EFBFBD>formatr<00>min<69>maxr<00>maZmaskedZint32<33>kind<6E>float32Zfloat16<31>float64<36>cbookZ_warn_external<61>astyperreZautoscale_None<6E>vmax<61>vmin<69>clip<69>itemr r'r<00> _interpd_<64>get_interpolation<6F> get_resample<6C>get_filternorm<72> get_filterradr6<00>mcolorsZNoNorm<72>mask<73>where<72>nan<61>array<61>isnanZ masked_arrayrPr<00>to_rgba<62>asarrayrrar <00>frozen<65>inverted<65>ymin<69>ymax<61>xmin<69>xmax)%rTrNZin_bboxZout_bboxZ clip_bboxr*<00> unsampled<65>round_to_pixel_borderZ clipped_bboxZout_width_baseZout_height_base<73>t0<74>tZ out_widthZ
out_heightZ extra_widthZ extra_heightZ inp_dtypeZa_minZa_maxZ scaled_dtype<70>daZA_scaledZdvZvmidZfactZnewminZnewmaxZ A_resampledr<64>Zout_maskZ out_alphar2Zoutput_arZ alpha_channelZsubsetr3r3r4<00> _make_image<67>s8
 


 
 

     
  

     

 







  










 
  $z_ImageBase._make_imagecCs td<01><01>dS)am
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) 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 : Affine2D
The affine transformation from image to pixel space.
z(The make_image method must be overriddenN)<01>NotImplementedError)rTr)r*r<>r3r3r4r)sz_ImageBase.make_imagecCsV|j|dd<02>\}}}}|dkr"dSt<01><00>|jd|jd<00>|}|<01>|||||<06>dS)zu
draw unsampled image. The renderer should support a draw_image method
with scale parameter.
T)r<>Nrr)rrr{rr=)rTr)rB<00>imr@rAr0r3r3r4<00>_draw_unsampled_image=s
z _ImageBase._draw_unsampled_imagecCsdS)z{
return True if the image is better to be drawn unsampled.
The derived class needs to override it.
Fr3)rTr)r3r3r4<00>_check_unsampled_imageLsz!_ImageBase._check_unsampled_imagec Os<>|<00><00>sd|_dS|<00><02>jdkr*d|_dS|<01><04>}|<00>|<04>|<04>|<00><07><00>|<04>|<00> <09><00>|<04>
|<00> <0B><00>|<00> |<01>r<>|<00> <0A>jr<>|<00>||<04>n0|<00>||<01><11><00>\}}}}|dk r<>|<01>||||<05>|<04><13>d|_dS)NFr)<14> get_visible<6C>stale<6C> get_arrayr;r<Z _set_gc_cliprrrZset_url<72>get_urlZset_gidZget_gidr<64>r|r}r<>rrHr=r?) rTr)<00>argsrirBr<>r@rAr0r3r3r4r:Ss(


z_ImageBase.drawc Cs<>|jdk r|<00>||<01>S|j|jk r*difS|j|j}}|<00><05>\}}}}||krZ||}}||krl||}}|dk r<>|dk r<>||ko<>|kno<>||ko<>|kn}nd}|ifS)zI
Test whether the mouse event occurred within the image.
NF)<06> _containsrRZinaxes<65>xdata<74>ydata<74>
get_extent) rT<00>
mouseeventr.r/r<>r<>r<>r<><00>insider3r3r4<00>containsqs
  

2z_ImageBase.containscCsHddlm}|j|jdkr*|jddd<05>n|jddd<07>}|<02>||<01>dS)z&Write the image to png file with fnamer)<01>_png<6E>lowerNrwT)ryre)<06>
matplotlibr<EFBFBD>r<>r\ro<00> write_png)rT<00>fnamer<65>r<>r3r3r4r<><00>s "
z_ImageBase.write_pngcCsbyddlm}Wntk
r$YnXt||j<01>r:t|<01>}tj|dd<04>|_|jjt j
kr|t <09> |jjt d<05>s|t d<06>|jj<08><01><01>|jjdks<>|jjdkr<>|jjd d
ks<>t d <0B>|jj<10><01><01>|jjdk<02>rLt <09>|jjt j<12>r<>d nd }|j<07><13>dks<>||j<07><14>k<00>rt<15>d<0E>t <09>|jd|<03>|_|jjt j
k<03>rLt <09>|jjt j<12><02>rL|j<07>t j
<EFBFBD>|_d|_d|_d|_dS)z<>
Set the image array.
Note that this function does *not* update the normalization used.
Parameters
----------
A : array-like or `PIL.Image.Image`
r)<01>ImageT)<01>copyZ same_kindz3Image data of dtype {} cannot be converted to floatrnrLrw)rLrzInvalid shape {} for image datarMrzmClipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).N)<1C>PILr<4C><00> ImportErrorr6<00> pil_to_arrayr<79><00>safe_masked_invalidrorrrZcan_cast<73>float<61> TypeErrorr<72>r~rZ
issubdtype<EFBFBD>integerr<72>r<><00>_log<6F>warningr<67>r<>rarsr<>)rTrNr<><00>highr3r3r4<00>set_data<74>s6
    
z_ImageBase.set_datacCs|<00>|<01>dS)z<>
Retained for backwards compatibility - use set_data instead.
Parameters
----------
A : array-like
N)r<>)rTrNr3r3r4<00> set_array<61>s
z_ImageBase.set_arraycCs|jS)a*
Return the interpolation method the image uses when resizing.
One of 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36',
'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom',
'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', or 'none'.
)<01>_interpolation)rTr3r3r4r<><00>s z_ImageBase.get_interpolationcCs8|dkrtd}|<01><01>}|tkr(td<03><01>||_d|_dS)a(
Set the interpolation method the image uses when resizing.
if None, use a value from rc setting. 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 : {'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'}
Nzimage.interpolationzIllegal interpolation stringT)rr<>r<>rr<>r<>)rT<00>sr3r3r4r_<00>sz_ImageBase.set_interpolationcCs|<00><00>}|jdko|jo|jS)z>Return whether the image can be composited with its neighbors.r)r|r<>r}Z is_separable)rTr0r3r3r4rI<00>s
z_ImageBase.can_compositecCs |dkrtd}||_d|_dS)z<>
Set whether image resampling is used.
Parameters
----------
v : bool or None
If None, use :rc:`image.resample` = True.
Nzimage.resampleT)r<00> _resampler<65>)rT<00>vr3r3r4r`s z_ImageBase.set_resamplecCs|jS)z(Return whether image resampling is used.)r<>)rTr3r3r4r<>sz_ImageBase.get_resamplecCst|<01>|_d|_dS)z<>
Set whether the resize filter normalizes the weights.
See help for `~.Axes.imshow`.
Parameters
----------
filternorm : bool
TN)<03>bool<6F> _filternormr<6D>)rTrgr3r3r4r]s
z_ImageBase.set_filternormcCs|jS)z8Return whether the resize filter normalizes the weights.)r<>)rTr3r3r4r<>sz_ImageBase.get_filternormcCs(t|<01>}|dkrtd<02><01>||_d|_dS)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)r<>r<00>
_filterradr<EFBFBD>)rTrh<00>rr3r3r4r^#s
z_ImageBase.set_filterradcCs|jS)zReturn the filterrad setting.)r<>)rTr3r3r4r<>2sz_ImageBase.get_filterrad)NNNNTrVF)ruFT)ruF)<1F>__name__<5F>
__module__<EFBFBD> __qualname__<5F>zorderrUrYrkrqrrrtr<>rr<>r<>rWZallow_rasterizationr:r<>r<>r<>r<>r<>r_rIr`r<>r]r<>r^r<><00> __classcell__r3r3)rmr4r7<00>sD
  
+
2   r7csfeZdZdd<02>Zd<18>fdd<08> Zdd d
<EFBFBD>Zdd d <0A>Zdd<0F>Zdd<11>Zdd<13>Z dd<15>Z
<EFBFBD>fdd<17>Z <0B>Z S)<1B> AxesImagecCsdt|jjj<03>S)NzAxesImage(%g,%g;%gx%g))rQrRr1rS)rTr3r3r4rU8szAxesImage.__str__Nr<00>@Fc
s.||_t<01>j|f||||||| d<01>|
<EFBFBD><02>dS)a<>
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
)rdrerfr\rgrhrN)<03>_extentrjrY) rTrcrdrerfr\<00>extentrgrhrri)rmr3r4rY;szAxesImage.__init__cCs.|j\}}}}t<01>||||g<04>}|<06>|jj<05>S)N)r<>r
Z from_extentsZ transformedrRZ transData)rTr)r%<00>x1r&<00>y1r1r3r3r4<00>get_window_extentcszAxesImage.get_window_extent<6E><00>?c CsX|<00><00>}|<00><01>\}}}}tt<03>||g||gg<02><01>} t| |<04>}
|j|j| |
|jj ||d<01>S)N)r<>)
r|r<>r
rr<>r r<>rorRr1) rTr)r*r<>r0r<>Zx2r<32><00>y2r1Ztransformed_bboxr3r3r4rhs
zAxesImage.make_imagecCs|<00><00>dko|<01><01>S)zK
Return whether the image would be better drawn unsampled.
r)r<>Zoption_scale_image)rTr)r3r3r4r<>ss z AxesImage._check_unsampled_imagecCs<>||_\}}}}||f||ff}|j<01>|<06>||g|jjdd<01><||g|jjdd<01><|jjrr|jj||fdd<02>|jjr<>|jj ||fdd<02>d|_
dS)ab
extent is data axes (left, right, bottom, top) for making image plots
This updates ax.dataLim, and, if autoscaling, sets viewLim
to tightly fit the image, regardless of dataLim. Autoscaling
state is not changed, so following this with ax.autoscale_view
will redo the autoscaling in accord with dataLim.
N)<01>autoT) r<>rRZupdate_datalimZ sticky_edgesr.r/Z _autoscaleXonZset_xlimZ _autoscaleYonZset_ylimr<6D>)rTr<>r<>r<>r<>r<>Zcornersr3r3r4<00>
set_extentzs  zAxesImage.set_extentcCsV|jdk r|jS|<00><01>}|\}}|jdkr>d|d|ddfSd|dd|dfSdS)z.Get the image extent: left, right, bottom, topNrvg<00><>g<00>?)r<>rqr\)rT<00>sz<73>numrows<77>numcolsr3r3r4r<><00>s

zAxesImage.get_extentcCs<>|<00><00>\}}}}|jdkr$||}}|<00><02>}t||g||gg<02>}tddg|jdd<04>g<02>}t||d<05>} |j|j}
} | <09>|
| g<02>} t t
<EFBFBD> | <0C><01>r<>dS| <0C> t <0A>\} }d| kr<>|jdkr<>nnd|kr<>|jdks<>ndS|| |fSdS)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
rvrNrn)ZboxinZboxoutr)r<>r\r<>r
rr r<>r<>Ztransform_pointrGrr<>r<>r!)rT<00>eventr<74>r<>r<>r<><00>arrZ data_extentZ array_extentr0r/r.Zpoint<6E>i<>jr3r3r4<00>get_cursor_data<74>s 

 :zAxesImage.get_cursor_datacsDt<00>|<01>dkr4|jr4dt<03>|jj<05>|<01><01><01><07>dSt<08><00> |<01>SdS)Nr<00>[<5B>])
rr~Zcolorbarr<72>Z
strip_math<EFBFBD> formatterZformat_data_short<72>striprj<00>format_cursor_data)rTr-)rmr3r4r<><00>s zAxesImage.format_cursor_data)NNNNNrr<>F)N)r<>F) r<>r<>r<>rUrYr<>rr<>r<>r<>r<>r<>r<>r3r3)rmr4r<>7s 

 r<>cs|eZdZdd<02><01>fdd<04>
Zdd<06>Zdd d
<EFBFBD>Zd d <0C>Zd d<0E>Zdd<10>Zdd<12>Z dd<14>Z
dd<16>Z <0B>fdd<18>Z <0C>fdd<1A>Z <0A>ZS)<1C>NonUniformImager)rfc st<00>j|f|<03>|<00>|<02>dS)z<>
kwargs are identical to those for AxesImage, except
that 'nearest' and 'bilinear' are the only supported 'interpolation'
options.
N)rjrYr_)rTrcrfri)rmr3r4rY<00>szNonUniformImage.__init__cCsdS)z;
return False. Do not use unsampled image.
Fr3)rTr)r3r3r4r<><00>sz&NonUniformImage._check_unsampled_image<67><00>?Fc Cs<>|jdkrtd<01><01>|rtd<02><01>|j}|jdkr<>|jtjkrV|j|dd<05>}|j<08> <09>|_
n>t<05> |dd<00>dd<00>tj fdd<03>}d|dd<00>dd<00>df<d|_
n<EFBFBD>|jtjkr<>d|<00> tj<06>}|jddk<02>rt<05>t|jd d<03>d <0C><02>tj<06>}||dd<00>dd<00>d d<08>f<d|dd<00>dd<00>df<|}d
|_
|jjj\}}}} |jjj\}
} } } t<05>| <0C>d t<05>|
<EFBFBD>d }t<05>| <0A>d t<05>| <0B>d }||9}||9}t<17>|j|j|t|<0F>t|<0E>|||||| ft|j<00>}||
| t<1E>fS) Nz"You must first set the image arrayz*unsampled not supported on NonUniformImagernT)ryrrMrLrFg<00>?)r)rorprr~rrrr<>rd<00>is_gray<61> is_grayscale<6C>repeatZnewaxisr<73>rr rQrR<00>viewLimrSr1<00>extentsr>r'Zpcolor<6F>_Ax<41>_Ayr!r<>r<>r )rTr)r*r<>rN<00>Br%r&Zv_widthZv_heightr@rAr<>r<>r#r"r<>r3r3r4r<00>s>

 "    zNonUniformImage.make_imagecCs<>t<00>|tj<02>}t<00>|tj<02>}tj|dd<02>}|j|jkrBdkr`nn|jdd<05>|j|jkshtd<06><01>|jdkrztd<08><01>|jd kr<>|jdd
kr<>td <0B><01>|jd kr<>|jddkr<>|jdd<05>|_||_||_ ||_
d |_ d|_ d S) a^
Set the grid for the pixel centers, and the pixel values.
*x* and *y* are monotonic 1-D ndarrays of lengths N and M,
respectively, specifying pixel centers
*A* is an (M,N) ndarray or masked array of values to be
colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA
array.
T)r<>rrrnzAxes don't match array shape)rnrLzCan only plot 2D or 3D datarL)rrLrz?3D arrays must have three (RGB) or four (RGBA) color componentsN) rr<>r<>r<>r<>r~rr<>ror<>r<>rar<>)rTr.r/rNr3r3r4r<><00>s 6
zNonUniformImage.set_datacGs td<01><01>dS)NzMethod not supported)r<>)rTr<>r3r3r4r<>szNonUniformImage.set_arraycCs(|dk r|dkrtd<03><01>t<01>||<01>dS)z|
Parameters
----------
s : str, None
Either 'nearest', 'bilinear', or ``None``.
N)rrz?Only nearest neighbor and bilinear interpolations are supported)r<>r<>r_)rTr<>r3r3r4r_sz!NonUniformImage.set_interpolationcCs6|jdkrtd<01><01>|jd|jd|jd|jdfS)NzMust set data firstrrw)rorpr<>r<>)rTr3r3r4r<>!s
zNonUniformImage.get_extentcCsdS)Nr3)rTr<>r3r3r4r]&szNonUniformImage.set_filternormcCsdS)Nr3)rTr<>r3r3r4r^)szNonUniformImage.set_filterradcs"|jdk rtd<01><01>t<02><00>|<01>dS)Nz'Cannot change colors after loading data)rorprj<00>set_norm)rTre)rmr3r4r<>,s
zNonUniformImage.set_normcs"|jdk rtd<01><01>t<02><00>|<01>dS)Nz'Cannot change colors after loading data)rorprj<00>set_cmap)rTrd)rmr3r4r<>1s
zNonUniformImage.set_cmap)r<>F)r<>r<>r<>rYr<>rr<>r<>r_r<>r]r^r<>r<>r<>r3r3)rmr4r<><00>s 
$  r<>csLeZdZdZd<11>fdd<04> Zddd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Zdd<10>Z <09>Z
S)<13> PcolorImagez<65>
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.
Nc s6t<00>j|||d<01>|<00>|<07>|dk r2|<00>|||<04>dS)z<>
cmap defaults to its rc setting
cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1
Additional kwargs are matplotlib.artist properties
)rerdN)rjrYrbr<>)rTrcr.r/rNrdreri)rmr3r4rY>s
zPcolorImage.__init__<5F><00>?Fc Cs:|jdkrtd<01><01>|rtd<02><01>|jj<04><05>}t<06>|d<03>}t<08> |<05>d<00>
tj <0B>}|jj j \}}}} t<08>|<08>dt<08>|<06>d}
t<08>| <09>dt<08>|<07>d} tt<08>|
|<00><01>}
tt<08>| |<00><01>} |jdkr<>|j|jdd<07>} | |_|jjdkr<>|j<12><13>|_n|j} |jj} t<16>|j|j| | |
| j| j| j| jf|<05>}|||t<1E>fS) Nz"You must first set the image arrayz&unsampled not supported on PColorImagerrMg<00>?T)ryrn)rorprrR<00>patchZ get_facecolorr<72>r<>rr<>r<>rr1r<>r>r!rsr~rdr<>r<>r<>r'Zpcolor2r<32>r<>r%r<>r&r<>r )rTr)r*r<>Zfc<66>bgr@rAr<>r<>r#r"rNZvlr<6C>r3r3r4rSs2
  
 zPcolorImage.make_imagecCsdS)NFr3)rTr)r3r3r4r<>qsz"PcolorImage._check_unsampled_imagecCs$tj|dd<02>}|dkr4tjd|jddtjd<06>}nt<02>|tj<05><02><07>}|dkrltjd|jddtjd<06>}nt<02>|tj<05><02><07>}|jdd<07>|jd|jdfkr<>t d|jdd<07>|jd|jdff<00><01>|j
d kr<>t d
<EFBFBD><01>|j
d k<02>r|jddk<02>r|jdd<07>|_d |_ |j
d k<02>r<>|jdd k<06>r<>|dd<03>dd<03>df|dd<03>dd<03>dfk<02> <0C><00>r<>|dd<03>dd<03>df|dd<03>dd<03>dfk<02> <0C><00>r<>d|_ nt d<0E><01>|d|dk<00>r<>|ddd<0F>}|dd<03>ddd<0F>f}|d|dk<00>r|ddd<0F>}|ddd<0F>}||_ ||_||_d|_d|_dS)a<>
Set the grid for the rectangle boundaries, and the data values.
*x* and *y* are monotonic 1-D ndarrays of lengths N+1 and M+1,
respectively, specifying rectangle boundaries. If None,
they will be created as uniform arrays from 0 through N
and 0 through M, respectively.
*A* is an (M,N) ndarray or masked array of values to be
colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA
array.
T)r<>Nrr)rrnz2Axes don't match array shape. Got %s, expected %s.)rnrLzA must be 2D or 3DrLF)rLrz+3D arrays must have RGB or RGBA as last dimrw)r<>r<>rZarangerr<>r<>Zravelr;rr~r<><00>allror<>r<>rsr<>)rTr.r/rNr3r3r4r<>tsB"&
 22zPcolorImage.set_datacGs td<01><01>dS)NzMethod not supported)r<>)rTr<>r3r3r4r<><00>szPcolorImage.set_arraycCs<>|j|j}}||jdksF||jdksF||jdksF||jdkrJdSt<04>|j|<02>d}t<04>|j|<03>d}y|j||fStk
r<EFBFBD>dSXdS)Nrrwr)r<>r<>r<>r<>rZ searchsortedro<00>
IndexError)rTr<>r.r/r<>r<>r3r3r4r<><00>szPcolorImage.get_cursor_data)NNNNN)r<>F) r<>r<>r<><00>__doc__rYrr<>r<>r<>r<>r<>r3r3)rmr4r<>7s
7r<>cs@eZdZdZdZd<0E>fdd<05> Zdd<07>Zdd
d <0B>Zd d <0A>Z<08>Z S)<10> FigureImagerrNc s:t<00>jd|||d<02>||_||_||_|<00>|<07>d|_dS)z<>
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)rerdr\g<00>?)rjrY<00>figure<72>ox<6F>oyrbr*)rT<00>figrdreZoffsetxZoffsetyr\ri)rmr3r4rY<00>s
zFigureImage.__init__cCs8|<00><00>\}}d|j|d|jd|j|d|jfS)z.Get the image extent: left, right, bottom, topg<00><>g<00>?)rqrr)rTr<>r<>r3r3r4r<><00>s zFigureImage.get_extent<6E><00>?Fc Cs<>|j|jj}t|j||j|g|j||jjd|j||jjdgg<02>}|j<01><07>\}}||j9}||j9}tddg||gg<02>}|j|j||||||dd<04>S)NrrF)r*r<>r<>) <09>dpirr
rrrorZget_size_inchesr<73>) rTr)r*r<>Zfacr1r#r"r<>r3r3r4r<00>s

zFigureImage.make_imagecCs"tj<01>|tj|dd<02><02>d|_dS)zSet the image array.T)r<>N)rZr[r<>r<>r<>r<>)rTrNr3r3r4r<><00>szFigureImage.set_data)NNrrN)rF)
r<EFBFBD>r<>r<>r<>r<>rYr<>rr<>r<>r3r3)rmr4r<00>s
rc sheZdZdZe<04>dd<03>d<16>fd d
<EFBFBD> <09>Ze<04>d<02>ed d <0C><00><01>Z d d<0E>Z
ddd<10>Z dd<12>Z ddd<15>Z <0A>ZS)<19> BboxImagez;The Image class whose size is determined by the given bbox.z3.1<EFBFBD>interp_at_nativeNr<00>@FTc
s:t<00>jd|||||||d<02>|
<EFBFBD><02>||_| |_t<04>|_dS)z<>
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)rdrerfr\rgrhr)N)rjrYr1<00>_interp_at_nativer <00>
_transform) rTr1rdrerfr\rgrhrr ri)rmr3r4rY<00>szBboxImage.__init__cCs|jS)N)r )rTr3r3r4r szBboxImage.interp_at_nativecCs|jS)N)r )rTr3r3r4r|#szBboxImage.get_transformcCsD|dkr|<00><00>j}t|jt<04>r$|jSt|j<03>r8|<00>|<01>Std<01><01>dS)Nzunknown type of bbox)Z
get_figureZ_cachedRendererr6r1r <00>callabler)rTr)r3r3r4r<>&s
 

zBboxImage.get_window_extentcCsL|jdk r|<00>||<01>S|<00><01>s&difS|j|j}}|<00><04><00>||<03>}|ifS)z7Test whether the mouse event occurred within the image.NF)r<>r<>r.r/r<>r<>)rTr<>r.r/r<>r3r3r4r<>1s
 zBboxImage.contains<6E><00>?c Cs~|<01><00>\}}|<00>|<01><01><02>}|j||g_|<00>|<01>}tddg||gg<02>}ttddgddgg<02>|<08>|_|j|j|||||d<03>S)Nrr)r<>) Zget_canvas_width_heightr<74>r<>Z_pointsr
r r r<>ro) rTr)r*r<>r#r"Zbbox_inZbbox_outr<74>r3r3r4r>s 
zBboxImage.make_image)NNNNrr
FT)N)rF)r<>r<>r<>rr<>Z_delete_parameterrY<00>
deprecated<EFBFBD>propertyr r|r<>r<>rr<>r3r3)rmr4r<00>s 

 rc Csrdd<02>}d|i}|dkr<>t|t<01>rdtj<03>|<00>}t|j<06>dkrBd}q<>tj<08> |<00>\}}|<05>
<EFBFBD>dd<04>}q<>t |d<06>r<>tj<08> |j <0C>\}}|<05>
<EFBFBD>dd<04>}q<>d}n|}||kr<>yddl m}Wn$tk
r<EFBFBD>td t|<03><00><01>YnX|<07>|<00><01>
}t|<08>SQRX||} t|t<01><02>rftj<03>|<00>}t|j<06>dk<04>rJdd
lm}
t|
<EFBFBD>|<00><01><17><00>} | | <0B>St|d <0B><02>
} | | <0B>SQRXn| |<00>SdS) a<>
Read an image from a file into an array.
Parameters
----------
fname : str or file-like
The image file to read. This can be a filename, a URL or a Python
file-like object opened in read-binary mode.
format : str, optional
The image file format assumed for reading the data. If not
given, the format is deduced from the filename. If nothing can
be deduced, PNG is tried.
Returns
-------
imagedata : :class:`numpy.array`
The image data. The returned array has shape
- (M, N) for grayscale images.
- (M, N, 3) for RGB images.
- (M, N, 4) for RGBA images.
Notes
-----
Matplotlib can only read PNGs natively. Further image formats are
supported via the optional dependency on Pillow. Note, URL strings
are not compatible with Pillow. Check the `Pillow documentation`_
for more information.
.. _Pillow documentation: http://pillow.readthedocs.io/en/latest/
c_sddlm}|j||<01>S)Nr)r<>)r<>r<><00>read_png)r<>rir<>r3r3r4rls zimread.<locals>.read_png<6E>pngNr<00>namer)r<>z_Only know how to handle extensions: %s; with Pillow installed matplotlib can handle more images)<01>request<73>rb)r6<00>str<74>urllib<69>parse<73>urlparser<00>scheme<6D>os<6F>path<74>splitextr<74><00>hasattrrr<>r<>r<>r<00>list<73>openr<6E>rr<00>urlopen<65>read) r<>r<>r<00>handlers<72>parsed<65>ext<78>basenamer<65>r,<00>handlerr<00>fdr3r3r4<00>imreadKs@!
 
     r)<00>dc
Cs<>ddlm}ddlm} t|tj<06>r.t<05>|<00>}|dkr^t|t<08>rRt |<00>j
dd<04>nt d<00> <0C>}|dkr<>||dd <09>}
|
j |||||d
d <0B>|
j|||d
d <0C><00>n6tj|d <0A>} | <0B>||<03>|dkr<>t d}|dkr<>|ddd<10>}| j|d
d<11>} |dk<02>r| j| ||d<13>n<>yddlm} Wn6tk
<EFBFBD>rL}ztd|<05>d<16><03>|<0E>Wdd}~XYnX| jd| jdf}| <0A>d|| dddd<05>}|dk<06>r<>d}tdd<1C>t<1A>t d<00>D<00><01>}| <0A>d||<11>}|<12>||<10>|}|j||||fd<1F>dS) a<>
Save an array as an image file.
Parameters
----------
fname : str or PathLike file-like
A path or a Python file-like object to store the image in.
If *format* is not set, then the output format is inferred from the
extension of *fname*, if any, and from :rc:`savefig.format` otherwise.
If *format* is set, it determines the output format.
arr : array-like
The image data. The shape can be one of
MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA).
vmin, vmax : scalar, optional
*vmin* and *vmax* set the color scaling for the image by fixing the
values that map to the colormap color limits. If either *vmin*
or *vmax* is None, that limit is determined from the *arr*
min/max value.
cmap : str or `~matplotlib.colors.Colormap`, optional
A Colormap instance or registered colormap name. The colormap
maps scalar data to colors. It is ignored for RGB(A) data.
Defaults to :rc:`image.cmap` ('viridis').
format : str, optional
The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when this
is unset is documented under *fname*.
origin : {'upper', 'lower'}, optional
Indicates whether the ``(0, 0)`` index of the array is in the upper
left or lower left corner of the axes. Defaults to :rc:`image.origin`
('upper').
dpi : int
The DPI to store in the metadata of the file. This does not affect the
resolution of the output image.
r)<01>Figure)r<>Nrzsavefig.format)ZpdfZpsZeps<70>svgF)r<00>frameonT)rdr<>r<>r\<00>resize)rr<>Z transparent)rdz image.originr<6E>rw)ryr)r)r<>z
Saving to z requires Pillow<6F>RGBA<42>raw)Zjpg<70>jpegr1css|]}t|d<00>VqdS)rMN)r!)r8r.r3r3r4r9<00>szimsave.<locals>.<genexpr>zsavefig.facecolor<6F>RGB)r<>r)<1F>matplotlib.figurer+r<>r<>r6r<00>PathLike<6B>fspathrr<00>suffixrr<>Zfigimage<67>savefigrZr[Zset_climr<6D>r<>r<>r<>r<>r<00>
frombufferrQr<>Zto_rgb<67>newZpaste<74>save)r<>r<>r<>r<>rdr<>r\rr+r<>r<00>smrOr<><00>excZ pil_shaper,<00>colorZ
backgroundr3r3r4<00>imsave<76>sL#   
    
"
 r>cCs<>|jdkrt<01>|<00>S|j<00>d<02>rp|<00>d|j<00>}|j<00>d<04>rHt<01>|d<05>}n t<01>|d<06>}|<02>|jddd<08><00><01> d <09>Sy|<00>
d
<EFBFBD>}Wnt k
r<EFBFBD>t d <0B><01>YnXt<01>|<00>SdS) aXLoad a `PIL image`_ and return it as a numpy array.
.. _PIL image: https://pillow.readthedocs.io/en/latest/reference/Image.html
Returns
-------
numpy.array
The array shape depends on the image type:
- (M, N) for grayscale images.
- (M, N, 3) for RGB images.
- (M, N, 4) for RGBA images.
)r/ZRGBXr2<00>LzI;16r0r<>z>u2z<u2Nrwz=u2r/zUnknown image mode) <0A>moderr<><00>
startswith<EFBFBD>tobytes<65>endswithr8Zreshaper;r<><00>convertrrp)ZpilImager0r.r3r3r4r<><00>s

   r<><><E79A99><EFBFBD><EFBFBD><EFBFBD>?rFcCs<>t|<00>}|j\}}}d} || |}
|| |} |rTddlm} | j| |
f| d<04>} n$ddlm}|| |
f| d<04>} t| <0A>| jddddgddggd <09>}|j |dd
|d <0B>| j
|| d <0C>| S) aw
Make a thumbnail of image in *infile* with output filename *thumbfile*.
See :doc:`/gallery/misc/image_thumbnail_sgskip`.
Parameters
----------
infile : str or file-like
The image file -- must be PNG, or Pillow-readable if you have Pillow_
installed.
.. _Pillow: http://python-pillow.org/
thumbfile : str or file-like
The thumbnail filename.
scale : float, optional
The scale factor for the thumbnail.
interpolation : str, optional
The interpolation scheme used in the resampling. See the
*interpolation* parameter of `~.Axes.imshow` for possible values.
preview : bool, optional
If True, the default backend (presumably a user interface
backend) will be used which will cause a figure to be raised if
`~matplotlib.pyplot.show` is called. If it is False, the figure is
created using `FigureCanvasBase` and the drawing backend is selected
as `~matplotlib.figure.savefig` would normally do.
Returns
-------
figure : `~.figure.Figure`
The figure instance containing the thumbnail.
r*rN)Zfigsizer)r+rr<>F)<04>aspectr-ZxticksZyticksT)rFrrf)r) r)rZmatplotlib.pyplotZpyplotrr3r+rZadd_axesZimshowr7)<10>infileZ thumbfiler{rf<00>previewr<77>Zrows<77>cols<6C>depthrr"r#Zpltrr+rcr3r3r4<00> thumbnails &      rK)r)N)N)NNNNNr*)rErF)Jr<00>ior<00>mathrr<00>logging<6E>pathlibr<00> urllib.parserZnumpyrr<>rZmatplotlib.artistZartistrWZmatplotlib.backend_basesrZmatplotlib.colors<72>colorsr<73>Z matplotlib.cmrZZmatplotlib.cbookr<6B>Zmatplotlib._imager'Zmatplotlib.transformsrr r
r r r <00> getLoggerr<72>r<>r(ZBILINEARZBICUBICZSPLINE16ZSPLINE36ZHANNINGZHAMMINGZHERMITEZKAISERZQUADRICZCATROMZGAUSSIANZBESSELZMITCHELLZSINCZLANCZOSZBLACKMANr<4E><00>setZinterpolations_namesr5rKrPrXr[r7r<>r<>r<>rrr)r>r<>rKr3r3r3r4<00><module>st           


;
- 
w=R
T
O#