TweakReflect

class TweakReflect[source]

Functor to change orientation of callout via reflection.

The adjustment is applied by reflecting the leader vertices about the centroid of the frame. Horizontal and/or vertical reflection can be specified.

__init__(*, horizontal: bool | None = None, vertical: bool | None = None) None[source]

Initialize the TweakReflect functor.

If neither horizontal or vertical are specified, a horizontal reflection will be performed.

Parameters:
  • horizontal (Optional[bool]) – Should the callout leader be reflected horizontally?

  • vertical (Optional[Tuple[float, float]], optional) – Should the callout leader be reflected vertically?

Methods

__init__(*, horizontal: bool | None = None, vertical: bool | None = None) None[source]

Initialize the TweakReflect functor.

If neither horizontal or vertical are specified, a horizontal reflection will be performed.

Parameters:
  • horizontal (Optional[bool]) – Should the callout leader be reflected horizontally?

  • vertical (Optional[Tuple[float, float]], optional) – Should the callout leader be reflected vertically?

__call__(leader_vertices: Sequence[Tuple[float, float]], ax: Axes | None = None) List[Tuple[float, float]][source]

Reflect leader vertices about centroid.

Parameters:
  • leader_vertices (Sequence[Tuple[float, float]]) – A sequence of tuples representing the (x, y) coordinates of the leader vertices.

  • ax (mpl_axes.Axes) –

    The matplotlib Axes object on which the leader vertices are plotted.

    Not used for this tweak.

Returns:

The updated leader vertices.

Return type:

List[Tuple[float, float]]