colour.plotting.plot_multi_sds#

colour.plotting.plot_multi_sds(sds: Sequence[SpectralDistribution | MultiSpectralDistributions] | MultiSpectralDistributions, plot_kwargs: Dict | List[Dict] | None = None, **kwargs: Any) Tuple[Figure, Axes][source]#

Plot given spectral distributions.

Parameters:
  • sds (Sequence[SpectralDistribution | MultiSpectralDistributions] | MultiSpectralDistributions) – Spectral distributions or multi-spectral distributions to plot. sds can be a single colour.MultiSpectralDistributions class instance, a list of colour.MultiSpectralDistributions class instances or a list of colour.SpectralDistribution class instances.

  • plot_kwargs (Dict | List[Dict] | None) –

    Keyword arguments for the matplotlib.pyplot.plot() definition, used to control the style of the plotted spectral distributions. plot_kwargs` can be either a single dictionary applied to all the plotted spectral distributions with the same settings or a sequence of dictionaries with different settings for each plotted spectral distributions. The following special keyword arguments can also be used:

    • illuminant : The illuminant used to compute the spectral distributions colours. The default is the illuminant associated with the whitepoint of the default plotting colourspace. illuminant can be of any type or form supported by the colour.plotting.common.filter_cmfs() definition.

    • cmfs : The standard observer colour matching functions used for computing the spectral distributions colours. cmfs can be of any type or form supported by the colour.plotting.common.filter_cmfs() definition.

    • normalise_sd_colours : Whether to normalise the computed spectral distributions colours. The default is True.

    • use_sd_colours : Whether to use the computed spectral distributions colours under the plotting colourspace illuminant. Alternatively, it is possible to use the matplotlib.pyplot.plot() definition color argument with pre-computed values. The default is True.

  • kwargs (Any) – {colour.plotting.artist(), colour.plotting.render()}, See the documentation of the previously listed definitions.

Returns:

Current figure and axes.

Return type:

tuple

Examples

>>> from colour import SpectralDistribution
>>> data_1 = {
...     500: 0.004900,
...     510: 0.009300,
...     520: 0.063270,
...     530: 0.165500,
...     540: 0.290400,
...     550: 0.433450,
...     560: 0.594500,
... }
>>> data_2 = {
...     500: 0.323000,
...     510: 0.503000,
...     520: 0.710000,
...     530: 0.862000,
...     540: 0.954000,
...     550: 0.994950,
...     560: 0.995000,
... }
>>> sd_1 = SpectralDistribution(data_1, name="Custom 1")
>>> sd_2 = SpectralDistribution(data_2, name="Custom 2")
>>> plot_kwargs = [
...     {"use_sd_colours": True},
...     {"use_sd_colours": True, "linestyle": "dashed"},
... ]
>>> plot_multi_sds([sd_1, sd_2], plot_kwargs=plot_kwargs)
... 
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
plot_multi_sds