graphinglib.Point#

class graphinglib.Point(x: float, y: float, label: str | None = None, face_color: str | None | Inherit = Inherit, edge_color: str | None | Inherit = Inherit, marker_size: float | Inherit = Inherit, marker_style: str | Inherit = Inherit, edge_width: float | Inherit = Inherit, alpha: float | Inherit = Inherit, font_size: int | Literal['same as figure'] = 'same as figure', text_color: str | Inherit = Inherit, h_align: str = 'left', v_align: str = 'bottom')[source]#

This class implements a point object.

The Point object can be used to show important coordinates in a plot or add a label to some point.

Parameters:
x, yfloat

The x and y coordinates of the Point.

labelstr, optional

Label to be attached to the Point.

face_colorstr or None

Face color of the marker. Default depends on the figure_style configuration.

edge_colorstr or None

Edge color of the marker. Default depends on the figure_style configuration.

marker_sizefloat

Size of the marker. Typical range is 10 to 100. Default depends on the figure_style configuration.

marker_stylestr

Style of the marker. Values include ".", ",", "o", "v", "^", "<", ">", "s", "p", "*", "h", "H", "+", "x", "D", "d", "|", and "_". Default depends on the figure_style configuration.

edge_widthfloat

Edge width of the marker. Typical range is 0 to 3. Default depends on the figure_style configuration.

alphafloat

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

font_sizefloat

Font size for the text attached to the marker. Typical range is 8 to 20. Default depends on the figure_style configuration.

text_colorstr

Color of the text attached to the marker. “same as point” uses the color of the point (prioritize edge color, then face color). Default depends on the figure_style configuration.

h_align, v_alignstr

Horizontal and vertical alignment of the text attached to the Point. Horizontal alignment values include "left", "center", and "right". Vertical alignment values include "bottom", "baseline", "center", "center_baseline", and "top". Defaults to bottom left.

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__(x, y[, label, face_color, ...])

This class implements a point object.

add_coordinates()

Displays the coordinates of the Point next to it.

copy()

Returns a deep copy of the Point object.

copy_with(**kwargs)

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