colour.plotting Package

Module Contents

colour.plotting.DEFAULT_PLOTTING_OECF(value)

Defines the sRGB colourspace transfer function.

Parameters:value (numeric or array_like) – Value.
Returns:Companded value.
Return type:numeric or ndarray
class colour.plotting.ColourParameter

Bases: tuple

ColourParameter(name, RGB, x, y0, y1)

RGB

Alias for field number 1

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__getstate__()

Exclude the OrderedDict from pickling

__repr__()

Return a nicely formatted representation string

name

Alias for field number 0

x

Alias for field number 2

y0

Alias for field number 3

y1

Alias for field number 4

colour.plotting.colour_cycle(**kwargs)

Returns a colour cycle iterator using given colour map.

Parameters:**kwargs (**) – {‘colour_cycle_map’, ‘colour_cycle_count’} Keywords arguments such as {'colour_cycle_map': unicode (Matplotlib colormap name), 'colour_cycle_count': int}
Returns:Colour cycle iterator.
Return type:cycle
colour.plotting.canvas(**kwargs)

Sets the figure size.

Parameters:**kwargs (**) – {‘figure_size’, } Keywords arguments such as {'figure_size': array_like (width, height), }
Returns:Current figure.
Return type:Figure
colour.plotting.camera(**kwargs)

Sets the camera settings.

Parameters:**kwargs (**) – {‘camera_aspect’, ‘elevation’, ‘azimuth’} Keywords arguments such as {'camera_aspect': unicode (Matplotlib axes aspect), 'elevation' : numeric, 'azimuth' : numeric}
Returns:Definition success.
Return type:bool
colour.plotting.decorate(**kwargs)

Sets the figure decorations.

Parameters:**kwargs (**) – {‘title’, ‘x_label’, ‘y_label’, ‘legend’, ‘legend_columns’, ‘legend_location’, ‘x_ticker’, ‘y_ticker’, ‘x_ticker_locator’, ‘y_ticker_locator’, ‘grid’, ‘grid_which’, ‘grid_axis’, ‘x_axis_line’, ‘y_axis_line’, ‘aspect’, ‘no_axes3d’} Keywords arguments such as {'title': unicode (figure title), 'x_label': unicode (X axis label), 'y_label': unicode (Y axis label), 'legend': bool, 'legend_columns': int, 'legend_location': unicode (Matplotlib legend location), 'x_ticker': bool, 'y_ticker': bool, 'x_ticker_locator': Locator, 'y_ticker_locator': Locator, 'grid': bool, 'grid_which': unicode, 'grid_axis': unicode, 'x_axis_line': bool, 'y_axis_line': bool, 'aspect': unicode (Matplotlib axes aspect), 'no_axes3d': bool}
Returns:Definition success.
Return type:bool
colour.plotting.boundaries(**kwargs)

Sets the plot boundaries.

Parameters:**kwargs (**) – {‘bounding_box’, ‘x_tighten’, ‘y_tighten’, ‘limits’, ‘margins’} Keywords arguments such as {'bounding_box': array_like (x min, x max, y min, y max), 'x_tighten': bool, 'y_tighten': bool, 'limits': array_like (x min, x max, y min, y max), 'limits': array_like (x min, x max, y min, y max)}
Returns:Definition success.
Return type:bool
colour.plotting.display(**kwargs)

Sets the figure display.

Parameters:**kwargs (**) – {‘standalone’, ‘filename’} Keywords arguments such as {'standalone': bool (figure is shown), 'filename': unicode (figure is saved as `filename`)}
Returns:Definition success.
Return type:bool
colour.plotting.label_rectangles(rectangles, rotation='vertical', text_size=10, offset=None)

Add labels above given rectangles.

Parameters:
  • rectangles (object) – Rectangles to used to set the labels value and position.
  • rotation (unicode, optional) – {‘horizontal’, ‘vertical’}, Labels orientation.
  • text_size (numeric, optional) – Labels text size.
  • offset (array_like, optional) – Labels offset as percentages of the largest rectangle dimensions.
Returns:

Definition success.

Return type:

bool

colour.plotting.equal_axes3d(axes)

Sets equal aspect ratio to given 3d axes.

Parameters:axes (object) – Axis to set the equal aspect ratio.
Returns:Definition success.
Return type:bool
colour.plotting.get_RGB_colourspace(colourspace)

Returns the RGB colourspace with given name.

Parameters:colourspace (unicode) – RGB colourspace name.
Returns:RGB colourspace.
Return type:RGB_Colourspace
Raises:KeyError – If the given RGB colourspace is not found in the factory RGB colourspaces.
colour.plotting.get_cmfs(cmfs)

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.get_illuminant(illuminant)

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.colour_parameter(name=None, RGB=None, x=None, y0=None, y1=None)

Defines a factory for colour.plotting.plots.COLOUR_PARAMETER attribute.

Parameters:
  • name (unicode, optional) – Colour name.
  • RGB (array_like, optional) – RGB Colour.
  • x (numeric, optional) – X data.
  • y0 (numeric, optional) – Y0 data.
  • y1 (numeric, optional) – Y1 data.
Returns:

ColourParameter.

Return type:

ColourParameter

colour.plotting.colour_parameters_plot(colour_parameters, y0_plot=True, y1_plot=True, **kwargs)

Plots given colour colour_parameters.

Parameters:
  • colour_parameters (list) – ColourParameter sequence.
  • y0_plot (bool, optional) – Plot y0 line.
  • y1_plot (bool, optional) – Plot y1 line.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> cp1 = colour_parameter(
...     x=390, RGB=[0.03009021, 0, 0.12300545])
>>> cp2 = colour_parameter(
...     x=391, RGB=[0.03434063, 0, 0.13328537], y0=0, y1=0.25)
>>> cp3 = colour_parameter(
...     x=392, RGB=[0.03826312, 0, 0.14276247], y0=0, y1=0.35)
>>> cp4 = colour_parameter(
...     x=393, RGB=[0.04191844, 0, 0.15158707], y0=0, y1=0.05)
>>> cp5 = colour_parameter(
...     x=394, RGB=[0.04535085, 0, 0.15986838], y0=0, y1=-.25)
>>> colour_parameters_plot(
...     [cp1, cp2, cp3, cp3, cp4, cp5])  
True
colour.plotting.single_colour_plot(colour_parameter, **kwargs)

Plots given colour.

Parameters:
  • colour_parameter (ColourParameter) – ColourParameter.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> RGB = (0.32315746, 0.32983556, 0.33640183)
>>> single_colour_plot(colour_parameter(RGB))  
True
colour.plotting.multi_colour_plot(colour_parameters, width=1, height=1, spacing=0, across=3, text_display=True, text_size='large', text_offset=0.075, **kwargs)

Plots given colours.

Parameters:
  • colour_parameters (list) – ColourParameter sequence.
  • width (numeric, optional) – Colour polygon width.
  • height (numeric, optional) – Colour polygon height.
  • spacing (numeric, optional) – Colour polygons spacing.
  • across (int, optional) – Colour polygons count per row.
  • text_display (bool, optional) – Display colour text.
  • text_size (numeric, optional) – Colour text size.
  • text_offset (numeric, optional) – Colour text offset.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> cp1 = colour_parameter(RGB=(0.45293517, 0.31732158, 0.26414773))
>>> cp2 = colour_parameter(RGB=(0.77875824, 0.57726450, 0.50453169))
>>> multi_colour_plot([cp1, cp2])  
True
colour.plotting.image_plot(image, label=None, label_size=15, label_colour=None, label_alpha=0.85, **kwargs)

Plots given image.

Parameters:
  • image (array_like) – Image to plot.
  • label (unicode, optional) – Image label.
  • label_size (int, optional) – Image label font size.
  • label_colour (array_like or unicode, optional) – Image label colour.
  • label_alpha (numeric, optional) – Image label alpha.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> import os
>>> from colour import read_image
>>> path = os.path.join(
...     'resources',
...     ('CIE_1931_Chromaticity_Diagram'
...     '_CIE_1931_2_Degree_Standard_Observer.png'))
>>> image = read_image(path)  
>>> image_plot(image)  
True
colour.plotting.single_spd_plot(spd, cmfs='CIE 1931 2 Degree Standard Observer', out_of_gamut_clipping=True, **kwargs)

Plots given spectral power distribution.

Parameters:
  • spd (SpectralPowerDistribution) – Spectral power distribution to plot.
  • out_of_gamut_clipping (bool, optional) – Out of gamut colours will be clipped if True otherwise, the colours will be offset by the absolute minimal colour leading to a rendering on gray background, less saturated and smoother. [1]_
  • 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.multi_spd_plot(spds, cmfs='CIE 1931 2 Degree Standard Observer', use_spds_colours=False, normalise_spds_colours=False, **kwargs)

Plots given spectral power distributions.

Parameters:
  • spds (list) – 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.single_cmfs_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

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.multi_cmfs_plot(cmfs=None, **kwargs)

Plots given colour matching functions.

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

Definition success.

Return type:

bool

Examples

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

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.multi_illuminants_relative_spd_plot(illuminants=None, **kwargs)

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.visible_spectrum_plot(cmfs='CIE 1931 2 Degree Standard Observer', out_of_gamut_clipping=True, **kwargs)

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.
  • out_of_gamut_clipping (bool, optional) – Out of gamut colours will be clipped if True otherwise, the colours will be offset by the absolute minimal colour leading to a rendering on gray background, less saturated and smoother. [1]_
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

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

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.multi_lightness_function_plot(functions=None, **kwargs)

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 1963')
>>> multi_lightness_function_plot(fs)  
True
colour.plotting.blackbody_spectral_radiance_plot(temperature=3500, cmfs='CIE 1931 2 Degree Standard Observer', blackbody='VY Canis Major', **kwargs)

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.blackbody_colours_plot(shape=SpectralShape(150.0, 12500.0, 50.0), cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

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
colour.plotting.colour_checker_plot(colour_checker='ColorChecker 2005', **kwargs)

Plots given colour checker.

Parameters:
  • colour_checker (unicode, optional) – Color checker name.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Raises:

KeyError – If the given colour rendition chart is not found in the factory colour rendition charts.

Examples

>>> colour_checker_plot()  
True
colour.plotting.CIE_1931_chromaticity_diagram_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots the CIE 1931 Chromaticity Diagram.

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

Definition success.

Return type:

bool

Examples

>>> CIE_1931_chromaticity_diagram_plot()  
True
colour.plotting.CIE_1960_UCS_chromaticity_diagram_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots the CIE 1960 UCS Chromaticity Diagram.

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

Definition success.

Return type:

bool

Examples

>>> CIE_1960_UCS_chromaticity_diagram_plot()  
True
colour.plotting.CIE_1976_UCS_chromaticity_diagram_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots the CIE 1976 UCS Chromaticity Diagram.

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

Definition success.

Return type:

bool

Examples

>>> CIE_1976_UCS_chromaticity_diagram_plot()  
True
colour.plotting.spds_CIE_1931_chromaticity_diagram_plot(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, **kwargs)

Plots given spectral power distribution chromaticity coordinates into the CIE 1931 Chromaticity Diagram.

Parameters:
  • spds (array_like, optional) – Spectral power distributions to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • annotate (bool) – Should resulting chromaticity coordinates annotated with their respective spectral power distribution names.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1931_chromaticity_diagram_plot([A, D65])  
True
colour.plotting.spds_CIE_1960_UCS_chromaticity_diagram_plot(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, **kwargs)

Plots given spectral power distribution chromaticity coordinates into the CIE 1960 UCS Chromaticity Diagram.

Parameters:
  • spds (array_like, optional) – Spectral power distributions to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • annotate (bool) – Should resulting chromaticity coordinates annotated with their respective spectral power distribution names.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1960_UCS_chromaticity_diagram_plot([A, D65])  
True
colour.plotting.spds_CIE_1976_UCS_chromaticity_diagram_plot(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, **kwargs)

Plots given spectral power distribution chromaticity coordinates into the CIE 1976 UCS Chromaticity Diagram.

Parameters:
  • spds (array_like, optional) – Spectral power distributions to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • annotate (bool) – Should resulting chromaticity coordinates annotated with their respective spectral power distribution names.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1976_UCS_chromaticity_diagram_plot([A, D65])  
True
colour.plotting.corresponding_chromaticities_prediction_plot(experiment=1, model='Von Kries', transform='CAT02', **kwargs)

Plots given chromatic adaptation model corresponding chromaticities prediction.

Parameters:
  • model (unicode, optional) – Corresponding chromaticities prediction models name.
  • model – Corresponding chromaticities prediction models name.
  • transform (unicode, optional) – Transformation to use with Von Kries chromatic adaptation model.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> corresponding_chromaticities_prediction_plot()  
True
colour.plotting.quad(plane='xy', origin=None, width=1, height=1, depth=0)

Returns the vertices of a quad geometric element in counter-clockwise order.

Parameters:
  • plane (array_like, optional) – {‘xy’, ‘xz’, ‘yz’}, Construction plane of the quad.
  • origin (array_like, optional) – Quad origin on the construction plane.
  • width (numeric, optional) – Quad width.
  • height (numeric, optional) – Quad height.
  • depth (numeric, optional) – Quad depth.
Returns:

Quad vertices.

Return type:

ndarray

Examples

>>> quad()
array([[0, 0, 0],
       [1, 0, 0],
       [1, 1, 0],
       [0, 1, 0]])
colour.plotting.grid(plane='xy', origin=None, width=1, height=1, depth=0, width_segments=1, height_segments=1)

Returns the vertices of a grid made of quads.

Parameters:
  • plane (array_like, optional) – {‘xy’, ‘xz’, ‘yz’}, Construction plane of the grid.
  • origin (array_like, optional) – Grid origin on the construction plane.
  • width (numeric, optional) – Grid width.
  • height (numeric, optional) – Grid height.
  • depth (numeric, optional) – Grid depth.
  • width_segments (int, optional) – Grid segments, quad counts along the width.
  • height_segments (int, optional) – Grid segments, quad counts along the height.
Returns:

Grid vertices.

Return type:

ndarray

Examples

>>> grid(width_segments=2, height_segments=2)
array([[[ 0. ,  0. ,  0. ],
        [ 0.5,  0. ,  0. ],
        [ 0.5,  0.5,  0. ],
        [ 0. ,  0.5,  0. ]],

       [[ 0. ,  0.5,  0. ],
        [ 0.5,  0.5,  0. ],
        [ 0.5,  1. ,  0. ],
        [ 0. ,  1. ,  0. ]],

       [[ 0.5,  0. ,  0. ],
        [ 1. ,  0. ,  0. ],
        [ 1. ,  0.5,  0. ],
        [ 0.5,  0.5,  0. ]],

       [[ 0.5,  0.5,  0. ],
        [ 1. ,  0.5,  0. ],
        [ 1. ,  1. ,  0. ],
        [ 0.5,  1. ,  0. ]]])
colour.plotting.cube(plane=None, origin=None, width=1, height=1, depth=1, width_segments=1, height_segments=1, depth_segments=1)

Returns the vertices of a cube made of grids.

Parameters:
  • plane (array_like, optional) – Any combination of {‘+x’, ‘-x’, ‘+y’, ‘-y’, ‘+z’, ‘-z’}, Included grids in the cube construction.
  • origin (array_like, optional) – Cube origin.
  • width (numeric, optional) – Cube width.
  • height (numeric, optional) – Cube height.
  • depth (numeric, optional) – Cube depth.
  • width_segments (int, optional) – Cube segments, quad counts along the width.
  • height_segments (int, optional) – Cube segments, quad counts along the height.
  • depth_segments (int, optional) – Cube segments, quad counts along the depth.
Returns:

Cube vertices.

Return type:

ndarray

Examples

>>> cube()
array([[[ 0.,  0.,  0.],
        [ 1.,  0.,  0.],
        [ 1.,  1.,  0.],
        [ 0.,  1.,  0.]],

       [[ 0.,  0.,  1.],
        [ 1.,  0.,  1.],
        [ 1.,  1.,  1.],
        [ 0.,  1.,  1.]],

       [[ 0.,  0.,  0.],
        [ 1.,  0.,  0.],
        [ 1.,  0.,  1.],
        [ 0.,  0.,  1.]],

       [[ 0.,  1.,  0.],
        [ 1.,  1.,  0.],
        [ 1.,  1.,  1.],
        [ 0.,  1.,  1.]],

       [[ 0.,  0.,  0.],
        [ 0.,  1.,  0.],
        [ 0.,  1.,  1.],
        [ 0.,  0.,  1.]],

       [[ 1.,  0.,  0.],
        [ 1.,  1.,  0.],
        [ 1.,  1.,  1.],
        [ 1.,  0.,  1.]]])
colour.plotting.RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots given RGB colourspaces in CIE 1931 Chromaticity Diagram.

Parameters:
  • colourspaces (array_like, optional) – RGB colourspaces to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
...     c)  
True
colour.plotting.RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots given RGB colourspaces in CIE 1960 UCS Chromaticity Diagram.

Parameters:
  • colourspaces (array_like, optional) – RGB colourspaces to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
...     c)  
True
colour.plotting.RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots given RGB colourspaces in CIE 1976 UCS Chromaticity Diagram.

Parameters:
  • colourspaces (array_like, optional) – RGB colourspaces to plot.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
...     c)  
True
colour.plotting.RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(RGB, colourspace, **kwargs)

Plots given RGB colourspace array in CIE 1931 Chromaticity Diagram.

Parameters:
  • RGB (array_like) – RGB colourspace array.
  • colourspace (RGB_Colourspace) – RGB colourspace of the RGB array.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
...     RGB, c)  
True
colour.plotting.RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(RGB, colourspace, **kwargs)

Plots given RGB colourspace array in CIE 1960 UCS Chromaticity Diagram.

Parameters:
  • RGB (array_like) – RGB colourspace array.
  • colourspace (RGB_Colourspace) – RGB colourspace of the RGB array.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
...     RGB, c)  
True
colour.plotting.RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(RGB, colourspace, **kwargs)

Plots given RGB colourspace array in CIE 1976 UCS Chromaticity Diagram.

Parameters:
  • RGB (array_like) – RGB colourspace array.
  • colourspace (RGB_Colourspace) – RGB colourspace of the RGB array.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(
...     RGB, c)  
True
colour.plotting.single_transfer_function_plot(colourspace='Rec. 709', **kwargs)

Plots given colourspace transfer function.

Parameters:
  • colourspace (unicode, optional) – RGB Colourspace transfer function to plot.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> single_transfer_function_plot()  
True
colour.plotting.multi_transfer_function_plot(colourspaces=None, inverse=False, **kwargs)

Plots given colourspaces transfer functions.

Parameters:
  • colourspaces (array_like, optional) – Colourspaces transfer functions to plot.
  • inverse (bool) – Plot inverse transfer functions.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> multi_transfer_function_plot(['Rec. 709', 'sRGB'])  
True
colour.plotting.single_munsell_value_function_plot(function='ASTM D1535-08', **kwargs)

Plots given Lightness function.

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

Definition success.

Return type:

bool

Examples

>>> f = 'ASTM D1535-08'
>>> single_munsell_value_function_plot(f)  
True
colour.plotting.multi_munsell_value_function_plot(functions=None, **kwargs)

Plots given Munsell value functions.

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

Definition success.

Return type:

bool

Raises:

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

Examples

>>> fs = ('ASTM D1535-08', 'McCamy 1987')
>>> multi_munsell_value_function_plot(fs)  
True
colour.plotting.single_rayleigh_scattering_spd_plot(CO2_concentration=300, temperature=288.15, pressure=101325, latitude=0, altitude=0, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots a single rayleigh scattering spectral power distribution.

Parameters:
  • CO2_concentration (numeric, optional) – \(CO_2\) concentration in parts per million (ppm).
  • temperature (numeric, optional) – Air temperature \(T[K]\) in kelvin degrees.
  • pressure (numeric) – Surface pressure \(P\) of the measurement site.
  • latitude (numeric, optional) – Latitude of the site in degrees.
  • altitude (numeric, optional) – Altitude of the site in meters.
  • cmfs (unicode, optional) – Standard observer colour matching functions.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> single_rayleigh_scattering_spd_plot()  
True
colour.plotting.the_blue_sky_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots the blue sky.

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

Definition success.

Return type:

bool

Examples

>>> the_blue_sky_plot()  
True
colour.plotting.single_spd_colour_rendering_index_bars_plot(spd, **kwargs)

Plots the colour rendering index of given illuminant or light source spectral power distribution.

Parameters:
  • spd (SpectralPowerDistribution) – Illuminant or light source spectral power distribution to plot the colour rendering index.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> single_spd_colour_rendering_index_bars_plot(  
...     illuminant)
True
colour.plotting.multi_spd_colour_rendering_index_bars_plot(spds, **kwargs)

Plots the colour rendering index of given illuminants or light sources spectral power distributions.

Parameters:
  • spds (array_like) – Array of illuminants or light sources spectral power distributions to plot the colour rendering index.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import (
...     ILLUMINANTS_RELATIVE_SPDS,
...     LIGHT_SOURCES_RELATIVE_SPDS)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> light_source = LIGHT_SOURCES_RELATIVE_SPDS.get('Kinoton 75P')
>>> multi_spd_colour_rendering_index_bars_plot(  
...     [illuminant, light_source])
True
colour.plotting.single_spd_colour_quality_scale_bars_plot(spd, **kwargs)

Plots the colour quality scale of given illuminant or light source spectral power distribution.

Parameters:
  • spd (SpectralPowerDistribution) – Illuminant or light source spectral power distribution to plot the colour quality scale.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> single_spd_colour_quality_scale_bars_plot(  
...     illuminant)
True
colour.plotting.multi_spd_colour_quality_scale_bars_plot(spds, **kwargs)

Plots the colour quality scale of given illuminants or light sources spectral power distributions.

Parameters:
  • spds (array_like) – Array of illuminants or light sources spectral power distributions to plot the colour quality scale.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> from colour import (
...     ILLUMINANTS_RELATIVE_SPDS,
...     LIGHT_SOURCES_RELATIVE_SPDS)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> light_source = LIGHT_SOURCES_RELATIVE_SPDS.get('Kinoton 75P')
>>> multi_spd_colour_quality_scale_bars_plot(  
...     [illuminant, light_source])
True
colour.plotting.planckian_locus_CIE_1931_chromaticity_diagram_plot(illuminants=None, **kwargs)

Plots the planckian locus and given illuminants in CIE 1931 Chromaticity Diagram.

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

Definition success.

Return type:

bool

Raises:

KeyError – If one of the given illuminant is not found in the factory illuminants.

Examples

>>> ils = ['A', 'B', 'C']
>>> planckian_locus_CIE_1931_chromaticity_diagram_plot(
...     ils)  
True
colour.plotting.planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(illuminants=None, **kwargs)

Plots the planckian locus and given illuminants in CIE 1960 UCS Chromaticity Diagram.

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

Definition success.

Return type:

bool

Raises:

KeyError – If one of the given illuminant is not found in the factory illuminants.

Examples

>>> ils = ['A', 'C', 'E']
>>> planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
...     ils)  
True
colour.plotting.RGB_colourspaces_gamuts_plot(colourspaces=None, reference_colourspace='CIE xyY', segments=8, grid=True, grid_segments=10, spectral_locus=False, spectral_locus_colour=None, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots given RGB colourspaces gamuts in given reference colourspace.

Parameters:
  • colourspaces (array_like, optional) – RGB colourspaces to plot the gamuts.
  • reference_colourspace (unicode, optional) – {‘CIE XYZ’, ‘CIE xyY’, ‘CIE Lab’, ‘CIE Luv’, ‘CIE UCS’, ‘CIE UVW’, ‘IPT’}, Reference colourspace to plot the gamuts into.
  • segments (int, optional) – Edge segments count for each RGB colourspace cubes.
  • grid (bool, optional) – Display a grid at the bottom of the RGB colourspace cubes.
  • grid_segments (bool, optional) – Edge segments count for the grid.
  • spectral_locus (bool, optional) – Is spectral locus line plotted.
  • spectral_locus_colour (array_like, optional) – Spectral locus line colour.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for spectral locus.
  • **kwargs (**) –

    {‘face_colours’, ‘edge_colours’, ‘edge_alpha’, ‘face_alpha’}, Arguments for each given colourspace where each key has an array_like value such as: { 'face_colours': (None, (0.5, 0.5, 1.0)), 'edge_colours': (None, (0.5, 0.5, 1.0)), 'edge_alpha': (0.5, 1.0), 'face_alpha': (0.0, 1.0)}

    {‘grid_face_colours’, ‘grid_edge_colours’, ‘grid_face_alpha’, ‘grid_edge_alpha’, ‘x_axis_colour’, ‘y_axis_colour’, ‘x_ticks_colour’, ‘y_ticks_colour’, ‘x_label_colour’, ‘y_label_colour’, ‘ticks_and_label_location’}, Arguments for the nadir grid such as {'grid_face_colours': (0.25, 0.25, 0.25), 'grid_edge_colours': (0.50, 0.50, 0.50), 'grid_face_alpha': 0.1, 'grid_edge_alpha': 0.5, 'x_axis_colour': (0.0, 0.0, 0.0, 1.0), 'y_axis_colour': (0.0, 0.0, 0.0, 1.0), 'x_ticks_colour': (0.0, 0.0, 0.0, 0.85), 'y_ticks_colour': (0.0, 0.0, 0.0, 0.85), 'x_label_colour': (0.0, 0.0, 0.0, 0.85), 'y_label_colour': (0.0, 0.0, 0.0, 0.85), 'ticks_and_label_location': ('-x', '-y')}

Returns:

Definition success.

Return type:

bool

Examples

>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_gamuts_plot(c)  
True
colour.plotting.RGB_scatter_plot(RGB, colourspace, reference_colourspace='CIE xyY', colourspaces=None, segments=8, grid=True, grid_segments=10, spectral_locus=False, spectral_locus_colour=None, points_size=12, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)

Plots given RGB colourspace array in a scatter plot.

Parameters:
  • RGB (array_like) – RGB colourspace array.
  • colourspace (RGB_Colourspace) – RGB colourspace of the RGB array.
  • reference_colourspace (unicode, optional) – {‘CIE XYZ’, ‘CIE xyY’, ‘CIE Lab’, ‘CIE Luv’, ‘CIE UCS’, ‘CIE UVW’, ‘IPT’}, Reference colourspace for colour conversion.
  • colourspaces (array_like, optional) – RGB colourspaces to plot the gamuts.
  • segments (int, optional) – Edge segments count for each RGB colourspace cubes.
  • grid (bool, optional) – Display a grid at the bottom of the RGB colourspace cubes.
  • grid_segments (bool, optional) – Edge segments count for the grid.
  • spectral_locus (bool, optional) – Is spectral locus line plotted.
  • spectral_locus_colour (array_like, optional) – Spectral locus line colour.
  • points_size (numeric, optional) – Scatter points size.
  • cmfs (unicode, optional) – Standard observer colour matching functions used for spectral locus.
  • **kwargs (**) –

    {‘face_colours’, ‘edge_colours’, ‘edge_alpha’, ‘face_alpha’}, Arguments for each given colourspace where each key has an array_like value such as: { 'face_colours': (None, (0.5, 0.5, 1.0)), 'edge_colours': (None, (0.5, 0.5, 1.0)), 'edge_alpha': (0.5, 1.0), 'face_alpha': (0.0, 1.0)}

    {‘grid_face_colours’, ‘grid_edge_colours’, ‘grid_face_alpha’, ‘grid_edge_alpha’, ‘x_axis_colour’, ‘y_axis_colour’, ‘x_ticks_colour’, ‘y_ticks_colour’, ‘x_label_colour’, ‘y_label_colour’, ‘ticks_and_label_location’}, Arguments for the nadir grid such as {'grid_face_colours': (0.25, 0.25, 0.25), 'grid_edge_colours': (0.50, 0.50, 0.50), 'grid_face_alpha': 0.1, 'grid_edge_alpha': 0.5, 'x_axis_colour': (0.0, 0.0, 0.0, 1.0), 'y_axis_colour': (0.0, 0.0, 0.0, 1.0), 'x_ticks_colour': (0.0, 0.0, 0.0, 0.85), 'y_ticks_colour': (0.0, 0.0, 0.0, 0.85), 'x_label_colour': (0.0, 0.0, 0.0, 0.85), 'y_label_colour': (0.0, 0.0, 0.0, 0.85), 'ticks_and_label_location': ('-x', '-y')}

Returns:

Definition success.

Return type:

bool

Examples

>>> c = 'Rec. 709'
>>> RGB_scatter_plot(c)  
True