�
���h. � �X � d dl Z d dlZd dlZddlmZ d
d�Zd� Zd� Z d� Z
dd�Zd� ZdS )� N� )�
basestring�default_colormap.csvc � � ddl m} t j t | � � }t j |d�� � j }|� d|� � S )z#
Returns viridis color map
r )�LinearSegmentedColormapN)�header�viridis) �matplotlib.colorsr �
pkg_resources�resource_stream�__name__�pd�read_csv�values� from_list)�fnamer �f�cm_datas �F/opt/cloudlinux/venv/lib/python3.11/site-packages/xarray/plot/utils.py�_load_default_cmapr sW � � :�9�9�9�9�9� �%�h��6�6�A��k�!�D�)�)�)�0�G�"�,�,�Y��@�@�@� c � � | � � � |k }| � � � |k }|r|rd}n|rd}n|rd}nd}|S )N�both�min�max�neither�r r )� calc_data�vmin�vmax�
extend_min�
extend_max�extends r �_determine_extendr$ sd � ������4�'�J������4�'�J�� �j� ���� � ���� � �������Mr c �� � ddl }|sd}|dk rd}n |dv rd}nd}t |� � |z dz
}t | |� � }|j � |||�� � \ }} t | d | � � |_ || fS )
zB
Build a discrete colormap and normalization of the data.
r Nr r r r � )r# �name)�
matplotlib�len�_color_palette�colors�from_levels_and_colors�getattrr' |