Defines the common plotting objects:
Resources directory.
RESOURCES_DIRECTORY : unicode
Default figure aspect ratio (Golden Number).
DEFAULT_FIGURE_ASPECT_RATIO : float
Default figure width.
DEFAULT_FIGURE_WIDTH : integer
Default figure height.
DEFAULT_FIGURE_HEIGHT : integer
Default figure size.
DEFAULT_FIGURE_SIZE : tuple
Default figure font size.
DEFAULT_FONT_SIZE : numeric
Default colour cycle for plots.
DEFAULT_COLOUR_CYCLE : tuple {‘r’, ‘g’, ‘b’, ‘c’, ‘m’, ‘y’, ‘k’}
Default hatch patterns for bar plots.
DEFAULT_HATCH_PATTERNS : tuple {‘\’, ‘o’, ‘x’, ‘.’, ‘*’, ‘//’}
Default plotting parameters.
DEFAULT_PARAMETERS : dict
Default plotting illuminant: CIE Illuminant D Series D65.
DEFAULT_PLOTTING_ILLUMINANT : tuple
Default plotting OECF / transfer function: sRGB.
DEFAULT_PLOTTING_OECF : object
Bases: tuple
ColourParameter(name, RGB, x, y0, y1)
Alias for field number 1
Return self as a plain tuple. Used by copy and pickle.
Exclude the OrderedDict from pickling
Return a nicely formatted representation string
Alias for field number 0
Alias for field number 2
Alias for field number 3
Alias for field number 4
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 |
Sets the figure size.
Parameters: | **kwargs (**) – {‘figure_size’, } Keywords arguments such as {'figure_size': array_like (width, height), } |
---|---|
Returns: | Current figure. |
Return type: | Figure |
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 |
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 |
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 |
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 |
Add labels above given rectangles.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Sets equal aspect ratio to given 3d axes.
Parameters: | axes (object) – Axis to set the equal aspect ratio. |
---|---|
Returns: | Definition success. |
Return type: | bool |
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. |
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. |
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. |
Defines a factory for colour.plotting.plots.COLOUR_PARAMETER attribute.
Parameters: |
|
---|---|
Returns: | ColourParameter. |
Return type: | ColourParameter |
Plots given colour colour_parameters.
Parameters: |
|
---|---|
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
Plots given colour.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> RGB = (0.32315746, 0.32983556, 0.33640183)
>>> single_colour_plot(colour_parameter(RGB))
True
Plots given colours.
Parameters: |
|
---|---|
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
Plots given image.
Parameters: |
|
---|---|
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