graphinglib.LegendMarker#

class graphinglib.LegendMarker(label: str, face_color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None = None, face_color_alt: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None = None, edge_color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None = None, edge_width: float = 1.0, marker_size: float = 6.0, marker_style: Any = 'o', fill_style: Literal['full', 'left', 'right', 'bottom', 'top'] = 'full', alpha: float = 1.0)[source]#

This class implements a legend marker wrapping the Line2D object with a marker style set for creating custom legend entries with the set_custom_legend() method. All parameters are also available as properties.

Parameters:
labelstr

The label for the legend line.

face_colorColorType

The color of the marker.

face_color_altColorType, optional

The alternative face color of the marker (for markers with two colors).

edge_colorColorType, optional

The color of the marker edge.

edge_widthfloat, optional

The width of the marker edge in points. Typical range is 0 to 3. Defaults to 1.0.

marker_sizefloat, optional

The size of the marker in points. Typical range is 4 to 12. Defaults to 6.0.

marker_styleAny, optional

The style of the marker, which can be any marker style supported by Matplotlib. Values include ".", ",", "o", "v", "^", "<", ">", "s", "p", "*", "h", "H", "+", "x", "D", "d", "|", and "_". Defaults to "o" (circle).

fill_style{“full”, “left”, “right”, “bottom”, “top”}, optional

The fill style of the marker. Values are "full", "left", "right", "bottom", and "top". Defaults to "full".

alphafloat, optional

The transparency level of the marker, between 0 (fully transparent) and 1 (fully opaque). Defaults to 1.0.

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