series
cheatah-plot v0.1.0-alpha — Biome Standard 0.6.3-alpha
Classes
Series— One drawable mark set: the data arrays and the style that draws them.
Functions
The neutral Series every constructor starts from: empty arrays, auto colour, house widths, solid stroke, no marker, no label, filled — ONE place the defaults live.
kind | the mark kind the constructor is building. |
the neutral Series with kind set.
O(1).
the Series (empty arrays).
systests/test_series.purrimport plot.series as series
let s = series.blank("line")
s.width = 2.5 # -> start from the house defaults, restyle what differsinline ::cheatah::ndarray::basic_ndarray< double > dash_pattern(builtins::Value auto &&on, builtins::Value auto &&off)
#
A dash pattern from on/off pixel lengths — the common two-segment pattern (pass it to the _styled constructors; an empty dash array means solid).
on | the drawn segment length in pixels (> 0). |
off | the gap length in pixels (> 0). |
the two-element dash array [on, off].
O(1).
the returned array.
systests/test_series.purrimport plot.series as series
import plot.color as color
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0])
let y = ndarray.array([1.0, 0.0, 1.0])
let d = series.dash_pattern(6.0, 3.0)
let c = color.auto_color()
let s = series.line_styled(x, y, c, 1.5, d, "") # -> a 6-on/3-off dashed lineSeries line(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
A line through (x, y) with the house defaults (auto colour, width 1.5, solid).
x | the x positions. |
y | the y values (same length). |
the line Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([0.0, 1.0, 4.0, 9.0])
let s = series.line(x, y) # -> a house-default line through the four pointsSeries line_styled(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y, plot::color::Color &c, builtins::Value auto &&width, ::cheatah::ndarray::basic_ndarray< double > &dash, builtins::Value auto &&label)
#
A line with the full style set: colour, width, dash pattern, legend label.
x | the x positions. |
y | the y values (same length). |
c | the line colour (alpha 0 = auto). |
width | the line width in pixels. |
dash | the dash pattern [on, off, ...]; empty = solid. |
label | the legend label ("" = unlabeled). |
the styled line Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import plot.color as color
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([0.0, 2.0, 1.0, 3.0])
let c = color.named("crimson")
let solid = ndarray.zeros([0])
let s = series.line_styled(x, y, c, 2.0, solid, "loss") # -> a bold labeled lineSeries scatter(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
Scatter points at (x, y) with the house defaults (auto colour, size 6, circle markers).
x | the x positions. |
y | the y values (same length). |
the scatter Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([1.0, 2.0, 3.0, 4.0])
let y = ndarray.array([2.1, 3.9, 6.2, 7.8])
let s = series.scatter(x, y) # -> circle markers at the four pointsSeries scatter_styled(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y, plot::color::Color &c, builtins::Value auto &&size, builtins::Value auto &&marker, builtins::Value auto &&label)
#
Scatter with the full style set: colour, marker size and shape, legend label.
x | the x positions. |
y | the y values (same length). |
c | the marker colour (alpha 0 = auto). |
size | the marker size in pixels. |
marker | the marker shape: "circle" | "square" | "diamond". |
label | the legend label ("" = unlabeled). |
the styled scatter Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import plot.color as color
import ndarray
let x = ndarray.array([1.0, 2.0, 3.0])
let y = ndarray.array([2.0, 1.0, 3.0])
let c = color.named("teal")
let s = series.scatter_styled(x, y, c, 9.0, "diamond", "runs") # -> big teal diamondsSeries scatter_grouped(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y, builtins::Value auto &&by)
#
Scatter with per-point group ids: points in the same group share a palette colour, and each group can take its own legend entry at the figure layer.
x | the x positions. |
y | the y values (same length). |
by | the per-point group ids (same length; small non-negative ints). |
the grouped scatter Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([1.0, 2.0, 1.5, 3.0])
let groups = [0, 0, 1, 1]
let s = series.scatter_grouped(x, y, groups) # -> one palette colour per groupSeries bar(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
Vertical bars at x with heights y, the house defaults (auto colour, 0.8 slot fraction, filled).
x | the bar positions (typically category centers). |
y | the bar heights (same length). |
the bar Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0])
let counts = ndarray.array([4.0, 7.0, 2.0])
let s = series.bar(x, counts) # -> three bars, each 0.8 of its slot wideSeries bar_styled(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y, plot::color::Color &c, builtins::Value auto &&width, builtins::Value auto &&fill, builtins::Value auto &&label)
#
Bars with the full style set: colour, slot-fraction width, fill vs outline, legend label.
x | the bar positions. |
y | the bar heights (same length). |
c | the bar colour (alpha 0 = auto). |
width | the bar width as a fraction of one slot (0..1]. |
fill | true = filled bars, false = outlines. |
label | the legend label ("" = unlabeled). |
the styled bar Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import plot.color as color
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0])
let y = ndarray.array([3.0, 5.0, 4.0])
let c = color.named("steelblue")
let s = series.bar_styled(x, y, c, 0.6, true, "2026") # -> slim filled labeled barsSeries area(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
A filled area between y and the x axis (auto colour).
x | the x positions. |
y | the top edge values (same length). |
the area Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([0.5, 1.5, 1.0, 2.0])
let s = series.area(x, y) # -> the region under the curve, filled to the axisSeries step(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
A step line through (x, y): each value holds until the next x (auto colour, width 1.5).
x | the x positions. |
y | the y values (same length). |
the step Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([1.0, 3.0, 2.0, 2.5])
let s = series.step(x, y) # -> each value holds until the next xSeries errorbar(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y, ::cheatah::ndarray::basic_ndarray< double > &ylo, ::cheatah::ndarray::basic_ndarray< double > &yhi)
#
Points with asymmetric error bars: whiskers span [ylo, yhi] at each x.
x | the x positions. |
y | the central values (same length). |
ylo | the lower whisker ends (absolute values, same length). |
yhi | the upper whisker ends (absolute values, same length). |
the errorbar Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0])
let y = ndarray.array([2.0, 3.0, 2.5])
let ylo = ndarray.array([1.7, 2.6, 2.2])
let yhi = ndarray.array([2.3, 3.4, 2.8])
let s = series.errorbar(x, y, ylo, yhi) # -> whiskers spanning [ylo, yhi]Series fill_between(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &ylo, ::cheatah::ndarray::basic_ndarray< double > &yhi)
#
A filled band between two curves: [ylo, yhi] at each x (auto colour).
x | the x positions. |
ylo | the band's lower edge (same length). |
yhi | the band's upper edge (same length). |
the fill_between Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0])
let ylo = ndarray.array([0.5, 1.0, 0.8])
let yhi = ndarray.array([1.5, 2.2, 1.9])
let s = series.fill_between(x, ylo, yhi) # -> a filled confidence-style bandSeries stem(::cheatah::ndarray::basic_ndarray< double > &x, ::cheatah::ndarray::basic_ndarray< double > &y)
#
Stems: a vertical line from the x axis to each (x, y), topped with a marker.
x | the x positions. |
y | the stem heights (same length). |
the stem Series.
O(1) — the arrays are shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let x = ndarray.array([0.0, 1.0, 2.0, 3.0])
let y = ndarray.array([1.0, -0.5, 2.0, 0.75])
let s = series.stem(x, y) # -> circle-topped stems rising or dropping from the axisA heatmap of a row-major 2-D grid: cell (row, col) is coloured by z through a colormap at the figure layer.
z | the 2-D value grid (row-major ndarray, shape [rows, cols]). |
the heatmap Series.
O(1) — the grid is shared, not copied.
the Series.
systests/test_series.purrimport plot.series as series
import ndarray
let flat = ndarray.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])
let z = ndarray.reshape(flat, [2, 3])
let s = series.heatmap(z) # -> a 2x3 grid, coloured through the figure's colormapABI/identity marker for the series cheatah module: returns the module name.
Auto-emitted by purrc's library emitter. It is the concrete symbol that anchors the module's signed static archive in opaque (source-hidden) builds.
the module name ("series").
