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:
-
- levelssequence of numbers
-
The quantization levels used to construct the
BoundaryNorm. Valuevis quantized to leveliiflev[i] <= v < lev[i+1]. - colorssequence of colors
-
The fill color to use for each level. If extend is "neither" there must be
n_level - 1colors. For an extend of "min" or "max" add one extra color, and for an extend of "both" add two colors. - extend{'neither', 'min', 'max', 'both'}, optional
-
The behaviour when a value falls out of range of the given levels. See
contourffor details.
- Returns:
-
-
cmap
Normalize -
norm
Colormap
-
cmap
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.7.5/api/_as_gen/matplotlib.colors.from_levels_and_colors.html