colour.plotting.plot_multi_colour_swatches#

colour.plotting.plot_multi_colour_swatches(colour_swatches: Sequence[ArrayLike | ColourSwatch], width: float = 1, height: float = 1, spacing: float = 0, columns: int | None = None, direction: Literal['+y', '-y'] | str = '+y', text_kwargs: dict | None = None, background_colour: ArrayLike = (1.0, 1.0, 1.0), compare_swatches: Literal['Diagonal', 'Stacked'] | str | None = None, **kwargs: Any) Tuple[Figure, Axes][source]#

Plot given colours swatches.

Parameters:
  • colour_swatches (Sequence[ArrayLike | ColourSwatch]) – Colour swatch sequence, either a regular ArrayLike or a sequence of colour.plotting.ColourSwatch class instances.

  • width (float) – Colour swatch width.

  • height (float) – Colour swatch height.

  • spacing (float) – Colour swatches spacing.

  • columns (int | None) – Colour swatches columns count, defaults to the colour swatch count or half of it if comparing.

  • direction (Literal['+y', '-y'] | str) – Row stacking direction.

  • text_kwargs (dict | None) –

    Keyword arguments for the matplotlib.pyplot.text() definition. The following special keywords can also be used:

    • offset: Sets the text offset.

    • visible: Sets the text visibility.

  • background_colour (ArrayLike) – Background colour.

  • compare_swatches (Literal['Diagonal', 'Stacked'] | str | None) – Whether to compare the swatches, in which case the colour swatch count must be an even number with alternating reference colour swatches and test colour swatches. Stacked will draw the test colour swatch in the center of the reference colour swatch, Diagonal will draw the reference colour swatch in the upper left diagonal area and the test colour swatch in the bottom right diagonal area.

  • 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

>>> RGB_1 = ColourSwatch((0.45293517, 0.31732158, 0.26414773))
>>> RGB_2 = ColourSwatch((0.77875824, 0.57726450, 0.50453169))
>>> plot_multi_colour_swatches([RGB_1, RGB_2])  
(<Figure size ... with 1 Axes>, <...Axes...>)
plot_multi_colour_swatches