str2d.Str2D.transormation_palette
- Str2D.transormation_palette(sep=' | ', expand=2, box=True) Str2D [source]
Show the transformation palette. This is a visual representation of the identity, transpose, horizontal flip, vertical flip, and 90 degree rotation of the data. The transformations are shown with alignment parameters and can be expanded and boxed.
- Parameters:
sep (str, optional) – The separator between the transformations, by default ‘ | ‘.
expand (int, optional) – The amount to expand the Str2D object, by default 2.
box (bool, optional) – Whether to box the Str2D object, by default True.
See also
show_with_alignment
Show the alignment parameters as part of a new Str2D object.
- Returns:
A new Str2D object with the transformations displayed.
- Return type:
Examples
Let’s create an instance of Str2D and assign it to the variable a.
from str2d import Str2D a = Str2D('ab\ncd')
We can show the transformation palette.
a.transormation_palette()
i | t | h | v | r | r2 | r3 ╭────╮ | ╭────╮ | ╭────╮ | ╭────╮ | ╭────╮ | ╭────╮ | ╭────╮ │ab │ | │ac │ | │ ba│ | │ │ | │ ca│ | │ │ | │ │ │cd │ | │bd │ | │ dc│ | │ │ | │ db│ | │ │ | │ │ │ │ | │ │ | │ │ | │cd │ | │ │ | │ dc│ | │bd │ │ │ | │ │ | │ │ | │ab │ | │ │ | │ ba│ | │ac │ ╰────╯ | ╰────╯ | ╰────╯ | ╰────╯ | ╰────╯ | ╰────╯ | ╰────╯ ------- | ------- | -------- | --------- | -------- | --------- | --------- v: top | v: top | v: top | v: bottom | v: top | v: bottom | v: bottom h: left | h: left | h: right | h: left | h: right | h: right | h: left