matplotlib.colors.from_levels_and_colors
- matplotlib.colors.from_levels_and_colors(levels, colors, extend='neither')[source]
-
A helper routine to generate a cmap and a norm instance which behave similar to contourf's levels and colors arguments.
- Parameters:
-
- levelsпоследовательность чисел
-
Уровни квантования, используемые для построения
BoundaryNorm. Значениеvквантуется до уровняiеслиlev[i] <= v < lev[i+1]. - colorsпоследовательность цветов
-
Цвет заливки, используемый для каждого уровня. Если extend равен "neither", должно быть
n_level - 1цветов. При extend "min" или "max" добавляется один дополнительный цвет, а при extend "both" — два. - extend{'neither', 'min', 'max', 'both'}, необязательно
-
Поведение, когда значение выходит за пределы заданных уровней. См.
contourfдля подробностей.
- Returns:
-
-
cmap
Normalize -
norm
Colormap
-
cmap
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.6.0/api/_as_gen/matplotlib.colors.from_levels_and_colors.html