colour.plotting Package¶
Sub-Packages¶
Sub-Modules¶
- colour.plotting.characterisation Module
- colour.plotting.colorimetry Module
- colour.plotting.common Module
- colour.plotting.corresponding Module
- colour.plotting.diagrams Module
- colour.plotting.geometry Module
- colour.plotting.models Module
- colour.plotting.notation Module
- colour.plotting.phenomenon Module
- colour.plotting.quality Module
- colour.plotting.temperature Module
- colour.plotting.volume Module
Module Contents¶
-
colour.plotting.
DEFAULT_PLOTTING_OECF
(value)¶ Defines the sRGB colourspace opto-electronic conversion function.
Parameters: value (numeric or array_like) – Value. Returns: Companded value. Return type: numeric or ndarray
-
class
colour.plotting.
ColourParameter
[source]¶ Bases:
colour.plotting.common.ColourParameter
Defines a data structure for plotting a colour polygon in various spectral figures.
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.
-
colour.plotting.
colour_cycle
(**kwargs)[source]¶ Returns a colour cycle iterator using given colour map.
Parameters: **kwargs (dict, optional) – {‘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)[source]¶ Sets the figure size.
Parameters: **kwargs (dict, optional) – {‘figure_size’, } Keywords arguments such as {'figure_size': array_like (width, height), }
Returns: Current figure. Return type: Figure
-
colour.plotting.
camera
(**kwargs)[source]¶ Sets the camera settings.
Parameters: **kwargs (dict, optional) – {‘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)[source]¶ Sets the figure decorations.
Parameters: **kwargs (dict, optional) – {‘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)[source]¶ Sets the plot boundaries.
Parameters: **kwargs (dict, optional) – {‘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)[source]¶ Sets the figure display.
Parameters: **kwargs (dict, optional) – {‘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)[source]¶ 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:
-
colour.plotting.
equal_axes3d
(axes)[source]¶ 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)[source]¶ 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)[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.
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.
colour_parameters_plot
(colour_parameters, y0_plot=True, y1_plot=True, **kwargs)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> cp1 = ColourParameter( ... x=390, RGB=[0.03009021, 0, 0.12300545]) >>> cp2 = ColourParameter( ... x=391, RGB=[0.03434063, 0, 0.13328537], y0=0, y1=0.25) >>> cp3 = ColourParameter( ... x=392, RGB=[0.03826312, 0, 0.14276247], y0=0, y1=0.35) >>> cp4 = ColourParameter( ... x=393, RGB=[0.04191844, 0, 0.15158707], y0=0, y1=0.05) >>> cp5 = ColourParameter( ... 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)[source]¶ Plots given colour.
Parameters: - colour_parameter (ColourParameter) – ColourParameter.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> RGB = (0.32315746, 0.32983556, 0.33640183) >>> single_colour_plot(ColourParameter(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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> cp1 = ColourParameter(RGB=(0.45293517, 0.31732158, 0.26414773)) >>> cp2 = ColourParameter(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, interpolation='nearest', colour_map=<Mock name='mock.cm.Greys_r' id='140326128301904'>, **kwargs)[source]¶ 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.
- interpolation (unicode, optional) – {‘nearest’, None, ‘none’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’, ‘mitchell’, ‘sinc’, ‘lanczos’} Image display interpolation.
- colour_map (unicode, optional) – Colour map used to display single channel images.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots given colour matching functions.
Parameters: - cmfs (unicode, optional) – Colour matching functions to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> single_cmfs_plot() True
-
colour.plotting.
multi_cmfs_plot
(cmfs=None, **kwargs)[source]¶ Plots given colour matching functions.
Parameters: - cmfs (array_like, optional) – Colour matching functions to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> single_illuminant_relative_spd_plot() True
-
colour.plotting.
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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[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.
- 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> visible_spectrum_plot() True
-
colour.plotting.
single_lightness_function_plot
(function='CIE 1976', **kwargs)[source]¶ Plots given Lightness function.
Parameters: - function (unicode, optional) – Lightness function to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> single_lightness_function_plot() True
-
colour.plotting.
multi_lightness_function_plot
(functions=None, **kwargs)[source]¶ Plots given Lightness functions.
Parameters: - functions (array_like, optional) – Lightness functions to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots blackbody colours.
Parameters: - shape (SpectralShape, optional) – Spectral shape to use as plot boundaries.
- cmfs (unicode, optional) – Standard observer colour matching functions.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> blackbody_colours_plot() True
-
colour.plotting.
colour_checker_plot
(colour_checker='ColorChecker 2005', **kwargs)[source]¶ Plots given colour checker.
Parameters: - colour_checker (unicode, optional) – Color checker name.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots the CIE 1931 Chromaticity Diagram.
Parameters: - cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> CIE_1931_chromaticity_diagram_plot() True
-
colour.plotting.
CIE_1960_UCS_chromaticity_diagram_plot
(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]¶ Plots the CIE 1960 UCS Chromaticity Diagram.
Parameters: - cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> CIE_1960_UCS_chromaticity_diagram_plot() True
-
colour.plotting.
CIE_1976_UCS_chromaticity_diagram_plot
(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]¶ Plots the CIE 1976 UCS Chromaticity Diagram.
Parameters: - cmfs (unicode, optional) – Standard observer colour matching functions used for diagram bounds.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots given chromatic adaptation model corresponding chromaticities prediction.
Parameters: - experiment (int, optional) – Corresponding chromaticities prediction experiment number.
- model (unicode, optional) – Corresponding chromaticities prediction model name.
- transform (unicode, optional) – Transformation to use with Von Kries chromatic adaptation model.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> corresponding_chromaticities_prediction_plot() True
-
colour.plotting.
quad
(plane='xy', origin=None, width=1, height=1, depth=0)[source]¶ 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)[source]¶ 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)[source]¶ 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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_conversion_function_plot
(colourspace='Rec. 709', EOCF=False, **kwargs)[source]¶ Plots given colourspace opto-electronic conversion function.
Parameters: - colourspace (unicode, optional) – RGB Colourspace opto-electronic conversion function to plot.
- EOCF (bool) – Plot electro-optical conversion function instead.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> single_conversion_function_plot() True
-
colour.plotting.
multi_conversion_function_plot
(colourspaces=None, EOCF=False, **kwargs)[source]¶ Plots given colourspaces opto-electronic conversion functions.
Parameters: - colourspaces (array_like, optional) – Colourspaces opto-electronic conversion functions to plot.
- EOCF (bool) – Plot electro-optical conversion functions instead.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> multi_conversion_function_plot(['Rec. 709', 'sRGB']) True
-
colour.plotting.
single_munsell_value_function_plot
(function='ASTM D1535-08', **kwargs)[source]¶ Plots given Lightness function.
Parameters: - function (unicode, optional) – Munsell value function to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> f = 'ASTM D1535-08' >>> single_munsell_value_function_plot(f) True
-
colour.plotting.
multi_munsell_value_function_plot
(functions=None, **kwargs)[source]¶ Plots given Munsell value functions.
Parameters: - functions (array_like, optional) – Munsell value functions to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> single_rayleigh_scattering_spd_plot() True
-
colour.plotting.
the_blue_sky_plot
(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]¶ Plots the blue sky.
Parameters: - cmfs (unicode, optional) – Standard observer colour matching functions.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: Examples
>>> the_blue_sky_plot() True
-
colour.plotting.
single_spd_colour_rendering_index_bars_plot
(spd, **kwargs)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ 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 (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots the planckian locus and given illuminants in CIE 1931 Chromaticity Diagram.
Parameters: - illuminants (array_like, optional) – Factory illuminants to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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)[source]¶ Plots the planckian locus and given illuminants in CIE 1960 UCS Chromaticity Diagram.
Parameters: - illuminants (array_like, optional) – Factory illuminants to plot.
- **kwargs (dict, optional) – Keywords arguments.
Returns: Definition success.
Return type: 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, display_grid=True, grid_segments=10, spectral_locus=False, spectral_locus_colour=None, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]¶ 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.
- display_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 (dict, optional) –
{‘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: 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, display_grid=True, grid_segments=10, spectral_locus=False, spectral_locus_colour=None, points_size=12, cmfs='CIE 1931 2 Degree Standard Observer', **kwargs)[source]¶ 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.
- display_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 (dict, optional) –
{‘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: Examples
>>> c = 'Rec. 709' >>> RGB_scatter_plot(c) True