colour.plotting.colorimetry Module

Colorimetry Plotting

Defines the colorimetry plotting objects:

colour.plotting.colorimetry.get_cmfs(cmfs)[source]

Returns the colour matching functions with given name.

Parameters:cmfs (Unicode) – Colour matching functions name.
Returns:Colour matching functions.
Return type:RGB_ColourMatchingFunctions or XYZ_ColourMatchingFunctions
Raises:KeyError – If the given colour matching functions is not found in the factory colour matching functions.
colour.plotting.colorimetry.get_illuminant(illuminant)[source]

Returns the illuminant with given name.

Parameters:illuminant (Unicode) – Illuminant name.
Returns:Illuminant.
Return type:SpectralPowerDistribution
Raises:KeyError – If the given illuminant is not found in the factory illuminants.
colour.plotting.colorimetry.single_spd_plot(spd, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]

Plots given spectral power distribution.

Parameters:
  • spd (SpectralPowerDistribution, optional) – Spectral power distribution to plot.
  • cmfs (unicode) – Standard observer colour matching functions used for spectrum creation.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import SpectralPowerDistribution
>>> data = {400: 0.0641, 420: 0.0645, 440: 0.0562}
>>> spd = SpectralPowerDistribution('Custom', data)
>>> single_spd_plot(spd)  
True
colour.plotting.colorimetry.multi_spd_plot(spds, cmfs='CIE 1931 2 Degree Standard Observer', use_spds_colours=False, normalise_spds_colours=False, **kwargs)[source]

Plots given spectral power distributions.

Parameters:
  • spds (list, optional) – Spectral power distributions to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for spectrum creation.
  • use_spds_colours (bool, optional) – Use spectral power distributions colours.
  • normalise_spds_colours (bool) – Should spectral power distributions colours normalised.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import SpectralPowerDistribution
>>> data1 = {400: 0.0641, 420: 0.0645, 440: 0.0562}
>>> data2 = {400: 0.134, 420: 0.789, 440: 1.289}
>>> spd1 = SpectralPowerDistribution('Custom1', data1)
>>> spd2 = SpectralPowerDistribution('Custom2', data2)
>>> multi_spd_plot([spd1, spd2])  
True
colour.plotting.colorimetry.single_cmfs_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]

Plots given colour matching functions.

Parameters:
  • cmfs (unicode, optional) – Colour matching functions to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> single_cmfs_plot()  
True
colour.plotting.colorimetry.multi_cmfs_plot(cmfss=None, **kwargs)[source]

Plots given colour matching functions.

Parameters:
  • cmfss (array_like, optional) – Colour matching functions to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> cmfss = [
... 'CIE 1931 2 Degree Standard Observer',
... 'CIE 1964 10 Degree Standard Observer']
>>> multi_cmfs_plot(cmfss)  
True
colour.plotting.colorimetry.single_illuminant_relative_spd_plot(illuminant='A', cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]

Plots given single illuminant relative spectral power distribution.

Parameters:
  • illuminant (unicode, optional) – Factory illuminant to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> single_illuminant_relative_spd_plot()  
True
colour.plotting.colorimetry.multi_illuminants_relative_spd_plot(illuminants=None, **kwargs)[source]

Plots given illuminants relative spectral power distributions.

Parameters:
  • illuminants (array_like, optional) – Factory illuminants to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> multi_illuminants_relative_spd_plot(['A', 'B', 'C'])  
True
colour.plotting.colorimetry.visible_spectrum_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]

Plots the visible colours spectrum using given standard observer CIE XYZ colour matching functions.

Parameters:
  • cmfs (unicode, optional) – Standard observer colour matching functions used for spectrum creation.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> visible_spectrum_plot()  
True
colour.plotting.colorimetry.single_lightness_function_plot(function='CIE 1976', **kwargs)[source]

Plots given Lightness function.

Parameters:
  • function (unicode, optional) – Lightness function to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> single_lightness_function_plot()  
True
colour.plotting.colorimetry.multi_lightness_function_plot(*args, **kwargs)[source]

Plots given Lightness functions.

Parameters:
  • functions (array_like, optional) – Lightness functions to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Raises:

KeyError – If one of the given Lightness function is not found in the factory Lightness functions.

Examples

>>> fs = ('CIE 1976', 'Wyszecki 1964')
>>> multi_lightness_function_plot(fs)  
True
colour.plotting.colorimetry.blackbody_spectral_radiance_plot(temperature=3500, cmfs='CIE 1931 2 Degree Standard Observer', blackbody='VY Canis Major', **kwargs)[source]

Plots given blackbody spectral radiance.

Parameters:
  • temperature (numeric, optional) – Blackbody temperature.
  • cmfs (unicode, optional) – Standard observer colour matching functions.
  • blackbody (unicode, optional) – Blackbody name.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> blackbody_spectral_radiance_plot()  
True
colour.plotting.colorimetry.blackbody_colours_plot(shape=SpectralShape(150, 12500, 50), cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]

Plots blackbody colours.

Parameters:
  • shape (SpectralShape, optional) – Spectral shape to use as plot boundaries.
  • cmfs (unicode, optional) – Standard observer colour matching functions.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> blackbody_colours_plot()  
True