pythagoras.label module¶
- class pythagoras.label.Label(x: float, y: float, tag: str, padding: float = 0.05, zord: int = 0)[source]¶
Bases:
PObjectA text label rendered from \({\rm \LaTeX}\).
- Variables:
x (float) – \(x\)-coordinate in Cartesian space.
y (float) – \(y\)-coordinate in Cartesian space.
tag (str) – \({\rm \LaTeX}\) string to render inside the label.
padding (float) – Spacing around the label (default 0.05).
zord – Drawing order; higher values are drawn later.
- extrema() list[tuple[float, float]][source]¶
Computes the furthermost points of the figure.
- Returns:
A list with the bounding points of the object.
- padding: float¶
- svg(ctx: RenderingContext, *args: POProperty) str[source]¶
Compiles the object into SVG commands.
- Parameters:
ctx – Context associated with the
Canvasinstance.args – Properties of the object.
- Returns:
The corresponding SVG code.
- tag: str¶
- tikz(ctx: RenderingContext, *args: POProperty) str[source]¶
Compiles the object into a sequence of TikZ instructions.
- Parameters:
ctx – Context associated with the
Canvasinstance.args – Properties of the object.
- Returns:
The resulting TikZ code.
- x: float¶
- y: float¶