matplotlib.colors.to_rgba_array#
- matplotlib.colors.to_rgba_array(c,alpha=None)[source]#
Convertc to a (n, 4) array of RGBA colors.
- Parameters:
- ccolor or list ofcolor or RGB(A) array
Ifc is a masked array, an
ndarrayis returned with a(0, 0, 0, 0) row for each masked value or row inc.- alphafloat or sequence of floats, optional
Ifalpha is given, force the alpha value of the returned RGBA tupletoalpha.
If None, the alpha value fromc is used. Ifc does not have analpha channel, then alpha defaults to 1.
alpha is ignored for the color value
"none"(case-insensitive),which always maps to(0,0,0,0).Ifalpha is a sequence andc is a single color,c will berepeated to match the length ofalpha.
- Returns:
- array
(n, 4) array of RGBA colors, where each channel (red, green, blue,alpha) can assume values between 0 and 1.
Examples usingmatplotlib.colors.to_rgba_array#
On this page