graphinglib.Line#

class graphinglib.Line(pointA: tuple[float, float], pointB: tuple[float, float], color: str | Inherit = Inherit, width: float | Inherit = Inherit, capped_line: bool = False, cap_width: float | Inherit = Inherit, alpha: float | Inherit = Inherit)[source]#

This class implements a line object.

Parameters:
pointAtuple[float, float]

Point A of the line.

pointBtuple[float, float]

Point B of the line.

colorstr

Color of the line. Default depends on the figure_style configuration.

widthfloat, optional

Line width. Typical range is 0.5 to 4. Default depends on the figure_style configuration.

capped_linebool

If True, the line is capped on both ends. Defaults to False.

cap_widthfloat

Width of the caps. Typical range is 0.5 to 4. Default depends on the figure_style configuration.

alphafloat

Opacity of the line. Range is 0 (transparent) to 1 (opaque). Default depends on the figure_style configuration.

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 between 0 and 1 ((0, 0, 1) or (0, 0, 1, 0.5)).

Methods

__init__(pointA, pointB[, color, width, ...])

copy()

Returns a deep copy of the Line object.

copy_with(**kwargs)

Returns a deep copy of the Plottable with specified attributes overridden.