colour.plotting.common.filter_passthrough#
- colour.plotting.common.filter_passthrough(mapping: Mapping, filterers: Any | str | Sequence[Any | str], allow_non_siblings: bool = True) dict [source]#
Return mapping objects matching given filterers while passing through class instances whose type is one of the mapping element types.
This definition allows passing custom but compatible objects to the various plotting definitions that by default expect the key from a dataset element.
For example, a typical call to
colour.plotting.plot_multi_illuminant_sds()
definition is as follows:>>> import colour >>> colour.plotting.plot_multi_illuminant_sds(["A"]) ...
With the previous example, it is also possible to pass a custom spectral distribution as follows:
>>> data = { ... 500: 0.0651, ... 520: 0.0705, ... 540: 0.0772, ... 560: 0.0870, ... 580: 0.1128, ... 600: 0.1360, ... } >>> colour.plotting.plot_multi_illuminant_sds( ... ["A", colour.SpectralDistribution(data)] ... ) ...
Similarly, a typical call to
colour.plotting.plot_planckian_locus_in_chromaticity_diagram_CIE1931()
definition is as follows:>>> colour.plotting.plot_planckian_locus_in_chromaticity_diagram_CIE1931( ... ["A"] ... ) ...
But it is also possible to pass a custom whitepoint as follows:
>>> colour.plotting.plot_planckian_locus_in_chromaticity_diagram_CIE1931( ... ["A", {"Custom": np.array([1 / 3 + 0.05, 1 / 3 + 0.05])}] ... ) ...
- Parameters:
mapping (Mapping) – Mapping to filter.
filterers (Any | str | Sequence[Any | str]) – Filterer or object class instance (which is passed through directly if its type is one of the mapping element types) or list of filterers.
allow_non_siblings (bool) – Whether to allow non-siblings to be also passed through.
- Returns:
Filtered mapping.
- Return type:
Notes
If the mapping passed is a
colour.utilities.CanonicalMapping
class instance, then the lower, slugified and canonical keys are also used for matching.