whitecanvas.layers.group package
Submodules
whitecanvas.layers.group.boxplot module
- class whitecanvas.layers.group.boxplot.BoxPlot(boxes: whitecanvas.layers.primitive.bars.Bars, whiskers: whitecanvas.layers.primitive.line.MultiLine, medians: whitecanvas.layers.primitive.line.MultiLine, *, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A group for boxplot.
Children layers are: - Bars (boxes) - MultiLine (whiskers) - MultiLine (median line) - Markers (outliers)
- ──┬── <– max
│
┌──┴──┐ <– 75% quantile │ o │ <– mean ╞═════╡ <– median └──┬──┘ <– 25% quantile
│
──┴── <– min
- property boxes: whitecanvas.layers.primitive.bars.Bars
The boxes layer (Bars).
- events: LayerEvents
- classmethod from_arrays(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, box_width: float = 0.3, capsize: float = 0.15, color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- property medians: whitecanvas.layers.primitive.line.MultiLine
The median line layer (MultiLine).
- property orient: whitecanvas.types._enums.Orientation
Orientation of the boxplot.
- property whiskers: whitecanvas.layers.primitive.line.MultiLine
The whiskers layer (MultiLine).
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.boxplot.BoxPlot [source]
Add edges to the strip plot.
- with_face(color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]], alpha: float | list[float] = 1.0, pattern: str | whitecanvas.types._enums.FacePattern | list[whitecanvas.types._enums.FacePattern] = FacePattern.SOLID) whitecanvas.layers.group.boxplot.BoxPlot [source]
Add face to the strip plot.
whitecanvas.layers.group.colorbar module
- class whitecanvas.layers.group.colorbar.Colorbar(cmap: cmap._colormap.Colormap, *, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- events: LayerEvents
- property lut: whitecanvas.layers.primitive.image.Image
The LUT image layer.
- property scale
The scale of the colorbar.
- property shift
The top-left corner of the colorbar.
whitecanvas.layers.group.graph module
- class whitecanvas.layers.group.graph.Graph(nodes: whitecanvas.layers.primitive.markers.Markers, edges: whitecanvas.layers.primitive.line.MultiLine, texts: whitecanvas.layers.primitive.text.Texts, edges_data: numpy.ndarray[typing.Any, numpy.dtype[numpy.int64]], name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- property edge_indices: numpy.ndarray[Any, numpy.dtype[numpy.int64]]
Current data of the edges.
- property edges: whitecanvas.layers.primitive.line.MultiLine
The edges layer.
- events: LayerEvents
- property nodes: whitecanvas.layers.primitive.markers.Markers
The nodes layer.
- set_graph(nodes: numpy.ndarray[Any, numpy.dtype[numpy.floating]], edges: numpy.ndarray[Any, numpy.dtype[numpy.int64]])[source]
Set the graph data.
- property text_offset: whitecanvas.layers.group._offsets.TextOffset
Return the text offset.
- property texts: whitecanvas.layers.primitive.text.Texts
The texts layer.
- with_text(strings: list[str], *, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', size: float = 12, rotation: float = 0.0, anchor: str | whitecanvas.types._enums.Alignment = Alignment.CENTER, fontfamily: str | None = None, offset: tuple[Any, Any] | None = None)[source]
whitecanvas.layers.group.labeled module
- class whitecanvas.layers.group.labeled.LabeledBars(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- property bars: whitecanvas.layers.primitive.bars.Bars
The bars layer.
- events: LayerEvents
- class whitecanvas.layers.group.labeled.LabeledLine(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- class whitecanvas.layers.group.labeled.LabeledMarkers(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property markers: whitecanvas.layers.primitive.markers.Markers
- class whitecanvas.layers.group.labeled.LabeledPlot(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
whitecanvas.layers.group.line_band module
- class whitecanvas.layers.group.line_band.LineBand(line: whitecanvas.layers.primitive.line.Line, band: whitecanvas.layers.primitive.band.Band, markers: whitecanvas.layers.primitive.markers.Markers | None = None, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
Group of Line, Band and Markers.
- Properties:
line: The central line layer band: The band region around the central line markers: The markers at the data points
- property band: whitecanvas.layers.primitive.band.Band
The band region layer.
- property data: whitecanvas.types._tuples.XYData
Current data of the central line.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The central line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
- with_markers(symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, color: typing.Union[str, typing.Iterable[int | float], cmap._color.Color, whitecanvas.types._alias._Void] = <whitecanvas.types._alias._Void object>, alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID) whitecanvas.layers.group.line_band.LineBand [source]
Add markers at the data points.
whitecanvas.layers.group.line_markers module
- class whitecanvas.layers.group.line_markers.Plot(line: whitecanvas.layers.primitive.line.Line, markers: whitecanvas.layers.primitive.markers.Markers, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A Plot layer is composed of a line and a markers layer.
- property data
The internal data of the line and markers.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
- with_edge(color: typing.Union[str, typing.Iterable[int | float], cmap._color.Color, whitecanvas.types._alias._Void] = <whitecanvas.types._alias._Void object>, alpha: float = 1.0, width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID) whitecanvas.layers.group.line_markers.Plot [source]
- with_text(strings: list[str], color: ColorType = 'black', size: float = 12, rotation: float = 0.0, anchor: str | Alignment = Alignment.BOTTOM_LEFT, fontfamily: str | None = None) LabeledPlot [source]
- with_xerr(err: ArrayLike, err_high: ArrayLike | None = None, color: ColorType | _Void = <whitecanvas.types._alias._Void object>, width: float | _Void = <whitecanvas.types._alias._Void object>, style: str | _Void = <whitecanvas.types._alias._Void object>, antialias: bool | _Void = <whitecanvas.types._alias._Void object>, capsize: float = 0) LabeledPlot [source]
- with_yerr(err: ArrayLike, err_high: ArrayLike | None = None, color: ColorType | _Void = <whitecanvas.types._alias._Void object>, width: float | _Void = <whitecanvas.types._alias._Void object>, style: str | _Void = <whitecanvas.types._alias._Void object>, antialias: bool | _Void = <whitecanvas.types._alias._Void object>, capsize: float = 0) LabeledPlot [source]
whitecanvas.layers.group.marker_collection module
- class whitecanvas.layers.group.marker_collection.MarkerCollection(markers: list[whitecanvas.layers.primitive.markers.Markers], *, name: str | None = None, extent: float = 0.3, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- classmethod build_strip(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, extent: float = 0.3, seed: int | None = 0, symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, color: Union[str, Iterable[int | float], cmap._color.Color, Sequence[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- classmethod build_swarm(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, extent: float = 0.3, symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, sort: bool = False, color: Union[str, Iterable[int | float], cmap._color.Color, Sequence[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- events: LayerEvents
- nth(n: int) whitecanvas.layers.primitive.markers.Markers [source]
The n-th markers layer.
- property orient: whitecanvas.types._enums.Orientation
Orientation of the strip plot.
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.marker_collection.MarkerCollection [source]
Add edges to the strip plot.
whitecanvas.layers.group.stemplot module
- class whitecanvas.layers.group.stemplot.StemPlot(markers: whitecanvas.layers.primitive.markers.Markers, lines: whitecanvas.layers.primitive.line.MultiLine, *, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- bbox_hint() numpy.ndarray[Any, numpy.dtype[numpy.float64]] [source]
Return the bounding box hint (xmin, xmax, ymin, ymax) of this group.
Note that unless children notifies the change of their bounding box hint, bbox hint needs recalculation.
- property bottom: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
Bottom of the stem.
- property data: whitecanvas.types._tuples.XYData
XYData as (x, height).
- events: LayerEvents
- classmethod from_arrays(xdata: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]]], ydata: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]]], bottom: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]], float] = 0, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL, backend: str | whitecanvas.backend._instance.Backend | None = None) whitecanvas.layers.group.stemplot.StemPlot [source]
- property lines: whitecanvas.layers.primitive.line.MultiLine
Lines for the stems.
- property markers: whitecanvas.layers.primitive.markers.Markers
Markers layer.
- property orient: whitecanvas.types._enums.Orientation
Orientation of the stem plot.
- property top: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
Top of the stem.
whitecanvas.layers.group.textinfo module
- class whitecanvas.layers.group.textinfo.BracketText(pos0: tuple[float, float], pos1: tuple[float, float], string: str = '', capsize: float = 0.1, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A group of shaped bracket and text.
This layer group is useful for such as annotating p-values.
text
┌────────┐
- property capsize: float
Cap size of the bracket.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
- property text: whitecanvas.layers.primitive.text.Texts
- class whitecanvas.layers.group.textinfo.Panel(origin: tuple[float, float], width: float, height: float, *, title: str = '', name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A rectangle titled with a text.
title
┌───────────┐ │ │ │ │ └───────────┘
- property bottom_left: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the bottom left corner of the panel.
- property bottom_right: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the bottom right corner of the panel.
- property center: tuple[float, float]
(x, y) of the center of the panel.
- events: LayerEvents
- property height: float
Height of the panel.
- property line: whitecanvas.layers.primitive.line.Line
Line layer of this panel.
- property text: whitecanvas.layers.primitive.text.Texts
Text layer of this panel.
- property top_left: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the top left corner of the panel.
- property top_right: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the top right corner of the panel.
- property width: float
Width of the panel.
whitecanvas.layers.group.violinplot module
- class whitecanvas.layers.group.violinplot.ViolinPlot(bands: dict[Hashable, whitecanvas.layers.primitive.band.Band], *, name: str | None = None, shape: Literal['both', 'left', 'right'] = 'both', extent: float = 0.5, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- events: LayerEvents
- property extent
- classmethod from_arrays(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, shape: Literal['both', 'left', 'right'] = 'both', extent: float = 0.5, kde_band_width: float | str = 'scott', color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- iter_children() Iterator[whitecanvas.layers.primitive.band.Band] [source]
Recursively iterate over all children.
- property offsets: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
- property orient: whitecanvas.types._enums.Orientation
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.violinplot.ViolinPlot [source]
Add edges to the strip plot.
Module contents
- class whitecanvas.layers.group.BoxPlot(boxes: whitecanvas.layers.primitive.bars.Bars, whiskers: whitecanvas.layers.primitive.line.MultiLine, medians: whitecanvas.layers.primitive.line.MultiLine, *, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A group for boxplot.
Children layers are: - Bars (boxes) - MultiLine (whiskers) - MultiLine (median line) - Markers (outliers)
- ──┬── <– max
│
┌──┴──┐ <– 75% quantile │ o │ <– mean ╞═════╡ <– median └──┬──┘ <– 25% quantile
│
──┴── <– min
- property boxes: whitecanvas.layers.primitive.bars.Bars
The boxes layer (Bars).
- events: LayerEvents
- classmethod from_arrays(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, box_width: float = 0.3, capsize: float = 0.15, color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- property medians: whitecanvas.layers.primitive.line.MultiLine
The median line layer (MultiLine).
- property orient: whitecanvas.types._enums.Orientation
Orientation of the boxplot.
- property whiskers: whitecanvas.layers.primitive.line.MultiLine
The whiskers layer (MultiLine).
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.boxplot.BoxPlot [source]
Add edges to the strip plot.
- with_face(color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]], alpha: float | list[float] = 1.0, pattern: str | whitecanvas.types._enums.FacePattern | list[whitecanvas.types._enums.FacePattern] = FacePattern.SOLID) whitecanvas.layers.group.boxplot.BoxPlot [source]
Add face to the strip plot.
- class whitecanvas.layers.group.BracketText(pos0: tuple[float, float], pos1: tuple[float, float], string: str = '', capsize: float = 0.1, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A group of shaped bracket and text.
This layer group is useful for such as annotating p-values.
text
┌────────┐
- property capsize: float
Cap size of the bracket.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
- property text: whitecanvas.layers.primitive.text.Texts
- class whitecanvas.layers.group.Graph(nodes: whitecanvas.layers.primitive.markers.Markers, edges: whitecanvas.layers.primitive.line.MultiLine, texts: whitecanvas.layers.primitive.text.Texts, edges_data: numpy.ndarray[typing.Any, numpy.dtype[numpy.int64]], name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- property edge_indices: numpy.ndarray[Any, numpy.dtype[numpy.int64]]
Current data of the edges.
- property edges: whitecanvas.layers.primitive.line.MultiLine
The edges layer.
- events: LayerEvents
- property nodes: whitecanvas.layers.primitive.markers.Markers
The nodes layer.
- set_graph(nodes: numpy.ndarray[Any, numpy.dtype[numpy.floating]], edges: numpy.ndarray[Any, numpy.dtype[numpy.int64]])[source]
Set the graph data.
- property text_offset: whitecanvas.layers.group._offsets.TextOffset
Return the text offset.
- property texts: whitecanvas.layers.primitive.text.Texts
The texts layer.
- with_text(strings: list[str], *, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', size: float = 12, rotation: float = 0.0, anchor: str | whitecanvas.types._enums.Alignment = Alignment.CENTER, fontfamily: str | None = None, offset: tuple[Any, Any] | None = None)[source]
- class whitecanvas.layers.group.LabeledBars(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- property bars: whitecanvas.layers.primitive.bars.Bars
The bars layer.
- events: LayerEvents
- class whitecanvas.layers.group.LabeledLine(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- class whitecanvas.layers.group.LabeledMarkers(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property markers: whitecanvas.layers.primitive.markers.Markers
- class whitecanvas.layers.group.LabeledPlot(layer: whitecanvas.layers._base.PrimitiveLayer, xerr: whitecanvas.layers.primitive.errorbars.Errorbars, yerr: whitecanvas.layers.primitive.errorbars.Errorbars, texts: whitecanvas.layers.primitive.text.Texts | None = None, name: str | None = None, offset: whitecanvas.layers.group._offsets.TextOffset = <NoOffset>)[source]
Bases:
whitecanvas.layers.group.labeled._LabeledLayerBase
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
- class whitecanvas.layers.group.LineBand(line: whitecanvas.layers.primitive.line.Line, band: whitecanvas.layers.primitive.band.Band, markers: whitecanvas.layers.primitive.markers.Markers | None = None, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
Group of Line, Band and Markers.
- Properties:
line: The central line layer band: The band region around the central line markers: The markers at the data points
- property band: whitecanvas.layers.primitive.band.Band
The band region layer.
- property data: whitecanvas.types._tuples.XYData
Current data of the central line.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The central line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
- with_markers(symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, color: typing.Union[str, typing.Iterable[int | float], cmap._color.Color, whitecanvas.types._alias._Void] = <whitecanvas.types._alias._Void object>, alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID) whitecanvas.layers.group.line_band.LineBand [source]
Add markers at the data points.
- class whitecanvas.layers.group.MarkerCollection(markers: list[whitecanvas.layers.primitive.markers.Markers], *, name: str | None = None, extent: float = 0.3, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- classmethod build_strip(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, extent: float = 0.3, seed: int | None = 0, symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, color: Union[str, Iterable[int | float], cmap._color.Color, Sequence[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- classmethod build_swarm(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, extent: float = 0.3, symbol: whitecanvas.types._enums.Symbol | str = Symbol.CIRCLE, size: float = 10, sort: bool = False, color: Union[str, Iterable[int | float], cmap._color.Color, Sequence[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1.0, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- events: LayerEvents
- nth(n: int) whitecanvas.layers.primitive.markers.Markers [source]
The n-th markers layer.
- property orient: whitecanvas.types._enums.Orientation
Orientation of the strip plot.
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.marker_collection.MarkerCollection [source]
Add edges to the strip plot.
- class whitecanvas.layers.group.Panel(origin: tuple[float, float], width: float, height: float, *, title: str = '', name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A rectangle titled with a text.
title
┌───────────┐ │ │ │ │ └───────────┘
- property bottom_left: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the bottom left corner of the panel.
- property bottom_right: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the bottom right corner of the panel.
- property center: tuple[float, float]
(x, y) of the center of the panel.
- events: LayerEvents
- property height: float
Height of the panel.
- property line: whitecanvas.layers.primitive.line.Line
Line layer of this panel.
- property text: whitecanvas.layers.primitive.text.Texts
Text layer of this panel.
- property top_left: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the top left corner of the panel.
- property top_right: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
(x, y) of the top right corner of the panel.
- property width: float
Width of the panel.
- class whitecanvas.layers.group.Plot(line: whitecanvas.layers.primitive.line.Line, markers: whitecanvas.layers.primitive.markers.Markers, name: str | None = None)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
A Plot layer is composed of a line and a markers layer.
- property data
The internal data of the line and markers.
- events: LayerEvents
- property line: whitecanvas.layers.primitive.line.Line
The line layer.
- property markers: whitecanvas.layers.primitive.markers.Markers
The markers layer.
- with_edge(color: typing.Union[str, typing.Iterable[int | float], cmap._color.Color, whitecanvas.types._alias._Void] = <whitecanvas.types._alias._Void object>, alpha: float = 1.0, width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID) whitecanvas.layers.group.line_markers.Plot [source]
- with_text(strings: list[str], color: ColorType = 'black', size: float = 12, rotation: float = 0.0, anchor: str | Alignment = Alignment.BOTTOM_LEFT, fontfamily: str | None = None) LabeledPlot [source]
- with_xerr(err: ArrayLike, err_high: ArrayLike | None = None, color: ColorType | _Void = <whitecanvas.types._alias._Void object>, width: float | _Void = <whitecanvas.types._alias._Void object>, style: str | _Void = <whitecanvas.types._alias._Void object>, antialias: bool | _Void = <whitecanvas.types._alias._Void object>, capsize: float = 0) LabeledPlot [source]
- with_yerr(err: ArrayLike, err_high: ArrayLike | None = None, color: ColorType | _Void = <whitecanvas.types._alias._Void object>, width: float | _Void = <whitecanvas.types._alias._Void object>, style: str | _Void = <whitecanvas.types._alias._Void object>, antialias: bool | _Void = <whitecanvas.types._alias._Void object>, capsize: float = 0) LabeledPlot [source]
- class whitecanvas.layers.group.StemPlot(markers: whitecanvas.layers.primitive.markers.Markers, lines: whitecanvas.layers.primitive.line.MultiLine, *, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- bbox_hint() numpy.ndarray[Any, numpy.dtype[numpy.float64]] [source]
Return the bounding box hint (xmin, xmax, ymin, ymax) of this group.
Note that unless children notifies the change of their bounding box hint, bbox hint needs recalculation.
- property bottom: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
Bottom of the stem.
- property data: whitecanvas.types._tuples.XYData
XYData as (x, height).
- events: LayerEvents
- classmethod from_arrays(xdata: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]]], ydata: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]]], bottom: Union[Sequence[Union[int, float, numpy.number]], numpy.ndarray[Any, numpy.dtype[numpy.number]], float] = 0, name: str | None = None, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL, backend: str | whitecanvas.backend._instance.Backend | None = None) whitecanvas.layers.group.stemplot.StemPlot [source]
- property lines: whitecanvas.layers.primitive.line.MultiLine
Lines for the stems.
- property markers: whitecanvas.layers.primitive.markers.Markers
Markers layer.
- property orient: whitecanvas.types._enums.Orientation
Orientation of the stem plot.
- property top: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
Top of the stem.
- class whitecanvas.layers.group.ViolinPlot(bands: dict[Hashable, whitecanvas.layers.primitive.band.Band], *, name: str | None = None, shape: Literal['both', 'left', 'right'] = 'both', extent: float = 0.5, orient: whitecanvas.types._enums.Orientation = Orientation.VERTICAL)[source]
Bases:
whitecanvas.layers.group._collections.ListLayerGroup
- events: LayerEvents
- property extent
- classmethod from_arrays(x: list[float], data: list[Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]], *, name: str | None = None, orient: str | whitecanvas.types._enums.Orientation = Orientation.VERTICAL, shape: Literal['both', 'left', 'right'] = 'both', extent: float = 0.5, kde_band_width: float | str = 'scott', color: Union[str, Iterable[int | float], cmap._color.Color, list[Union[str, Iterable[int | float], cmap._color.Color]]] = 'blue', alpha: float = 1, pattern: str | whitecanvas.types._enums.FacePattern = FacePattern.SOLID, backend: str | whitecanvas.backend._instance.Backend | None = None)[source]
- iter_children() Iterator[whitecanvas.layers.primitive.band.Band] [source]
Recursively iterate over all children.
- property offsets: numpy.ndarray[Any, numpy.dtype[numpy.floating]]
- property orient: whitecanvas.types._enums.Orientation
- with_edge(*, color: Union[str, Iterable[int | float], cmap._color.Color] = 'black', width: float = 1.0, style: str | whitecanvas.types._enums.LineStyle = LineStyle.SOLID, alpha: float = 1.0) whitecanvas.layers.group.violinplot.ViolinPlot [source]
Add edges to the strip plot.