color_matching_xyz#
- colorsynth.color_matching_xyz(wavelength, axis=-1)[source]#
The CIE 1931 \(\overline{x}(\lambda)\), \(\overline{y}(\lambda)\), and \(\overline{z}(\lambda)\) color matching functions.
Stack the results of
color_matching_x(),color_matching_y(), andcolor_matching_z()into a single array.- Parameters:
- Return type:
Examples
Plot \(\overline{x}(\lambda)\), \(\overline{y}(\lambda)\), and \(\overline{z}(\lambda)\) over the entire human visible wavelength range.
import numpy as np import matplotlib.pyplot as plt import astropy.units as u import astropy.visualization import colorsynth wavelength = np.linspace(380, 780, num=101) * u.nm xyz = colorsynth.color_matching_xyz(wavelength, axis=0) with astropy.visualization.quantity_support(): plt.figure() plt.plot(wavelength, xyz[0], color="red", label=r"$\overline{x}(\lambda)$") plt.plot(wavelength, xyz[1], color="green", label=r"$\overline{y}(\lambda)$") plt.plot(wavelength, xyz[2], color="blue", label=r"$\overline{z}(\lambda)$") plt.legend()