U
    Gvf6  ã                   @   sF   d dl Zd dlZd dlmZ d dlmZ ddgZ	ddd„Z
dd„ ZdS )é    NÚpalplotÚdogploté   c                 C   sž   t | ƒ}tjdd|| |fd\}}|jt |¡ d|¡tj 	t
| ƒ¡ddd | t |¡d ¡ | ddg¡ | dd	„ t|ƒD ƒ¡ |j t ¡ ¡ d
S )zõPlot the values in a color palette as a horizontal array.

    Parameters
    ----------
    pal : sequence of matplotlib colors
        colors, i.e. as returned by seaborn.color_palette()
    size :
        scaling factor for size of plot

    r   )ÚfigsizeZnearestÚauto)ZcmapÚinterpolationZaspectg      à?g      à¿c                 S   s   g | ]}d ‘qS )Ú © )Ú.0Ú_r	   r	   ú4/tmp/pip-unpacked-wheel-ir0tye89/seaborn/miscplot.pyÚ
<listcomp>   s     zpalplot.<locals>.<listcomp>N)ÚlenÚpltÚsubplotsÚimshowÚnpZarangeZreshapeÚmplÚcolorsZListedColormapÚlistZ
set_xticksZ
set_yticksZset_xticklabelsÚrangeZyaxisZset_major_locatorÚtickerZNullLocator)ZpalÚsizeÚnr   Úaxr	   r	   r   r   	   s     þc            
      O   s‚   ddl m} ddlm} d}tj dd¡}||| |¡ƒ ¡ ƒ}t	 
|¡}t	jddd	\}}	| ddd
d
¡ |	 |¡ |	 ¡  dS )zWho's a good boy?r   )Úurlopen)ÚBytesIOz@https://github.com/mwaskom/seaborn-data/raw/master/png/img{}.pngé   é   )é   r   éd   )r   Zdpir   N)Úurllib.requestr   Úior   r   ÚrandomÚrandintÚformatÚreadr   Zimreadr   Zsubplots_adjustr   Zset_axis_off)
r   Ú__r   r   ÚurlZpicÚdataÚimgÚfr   r	   r	   r   r   !   s    

)r   )Znumpyr   Z
matplotlibr   Zmatplotlib.pyplotZpyplotr   Zmatplotlib.tickerr   Ú__all__r   r   r	   r	   r	   r   Ú<module>   s   
