graphinglib.Hlines#

class graphinglib.Hlines(y: ArrayLike, x_min: TypeAliasForwardRef('ArrayLike') | None = None, x_max: TypeAliasForwardRef('ArrayLike') | None = None, label: str | None = None, colors: list[str] | str | Inherit = Inherit, line_widths: list[float] | float | Inherit = Inherit, line_styles: list[str] | str | Inherit = Inherit, alpha: float | Inherit = Inherit)[source]#

This class implements simple horizontal lines.

Parameters:
yArrayLike

Vertical positions at which the lines should be plotted.

x_minArrayLike, optional

Horizontal start position of the lines. Each lines can have a different start. If not specified, lines will span the entire axes. Defaults to None.

x_maxArrayLike, optional

Horizontal end position of the lines. Each lines can habe a different end. If not specified, lines will span the entire axes. Defaults to None.

labelstr, optional

Label to be displayed in the legend.

colorslist[str]

Colors to use for the lines. One color for every line or a color per line can be specified. Default depends on the figure_style configuration.

line_widthslist[float]

Line widths to use for the lines. One width for every line or a width per line can be specified. Typical range is 0.5 to 4. Default depends on the figure_style configuration.

line_styleslist[str]

Line styles to use for the lines. One style for every line or a style per line can be specified. Values include "-", "--", "-.", ":", "solid", "dashed", "dashdot", and "dotted". Default depends on the figure_style configuration.

alphafloat

Opacity of the lines. 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__(y[, x_min, x_max, label, colors, ...])

copy()

Returns a deep copy of the Hlines object.

copy_with(**kwargs)

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