graphinglib.Arrow#
- class graphinglib.Arrow(pointA: tuple[float, float], pointB: tuple[float, float], color: str | Inherit = Inherit, width: float | Inherit = Inherit, head_size: float | Inherit = Inherit, shrink: float = 0, style: Literal['->', '-|>', '-[', ']->', 'simple', 'fancy', 'wedge'] | Inherit = Inherit, alpha: float | Inherit = Inherit, two_sided: bool = False)[source]#
This class implements an arrow object.
- Parameters:
- pointAtuple[float, float]
Point A of the arrow. If the arrow is single-sided, refers to the tail.
- pointBtuple[float, float]
Point B of the arrow. If the arrow is single-sided, refers to the head.
- colorstr
Color of the arrow. Default depends on the
figure_styleconfiguration.- widthfloat, optional
Arrow line width. Typical range is
0.5to4. Default depends on thefigure_styleconfiguration.- head_sizefloat, optional
Scales the size of the arrow head. Typical range is
0.5to3. Default depends on thefigure_styleconfiguration.- style
Literal["->", "-|>", "-[", "]->", "simple", "fancy", "wedge"] | Inherit, optional The style of the arrow. For a visual explanation of all available styles, see the gallery Arrow Styles example. Values are
"->","-|>","-[","]->","simple","fancy", and"wedge". Default depends on thefigure_styleconfiguration.Warning
The
styleparameter differs slightly from matplotlib’sarrowstylesince GraphingLib also uses atwo_sidedparameter to explicitly define whether the arrow is single or double-sided.- shrinkfloat
Fraction of the total length of the arrow to shrink from both ends. Range is
0to0.5. A value of0.5means the arrow is no longer visible. Defaults to 0.- alphafloat
Opacity of the arrow. Range is
0(transparent) to1(opaque). Default depends on thefigure_styleconfiguration.- two_sidedbool
If
True, an arrow is shown at both head and tail. Defaults toFalse.
Notes
Color parameters accept Matplotlib color formats: named colors (
"blue"), short color strings ("b"), hex strings ("#0000ff"), grayscale strings ("0.5"), and RGB/RGBA tuples with values between0and1((0, 0, 1)or(0, 0, 1, 0.5)).Methods