Skip to content
Single Axis

Single Axis

A single-axis chart.

Single Axis

Usage

from dataviz_mojo import single_axis
from dataviz_mojo.plot import save
from dataviz_mojo.theme import Theme

def main() raises:
    var response_ms: List[Float64] = [
        12.0, 14.0, 13.0, 15.0, 11.0, 14.0, 13.0, 12.0, 45.0, 15.0, 13.0, 14.0, 12.0, 90.0, 14.0,
    ]

    var c = single_axis(response_ms)
    save(c, "docs/src/examples/out_single_axis.svg")

Args:

  • x: The continuous column, one entry per point, plotted along the single horizontal axis.
  • color: Optional continuous color channel, mapped through a gradient spanning its own [min, max]; mutually exclusive with color_categories. Left empty (the default), every point uses Theme.mark_color.
  • color_categories: Optional discrete color channel, palette- colored by each value’s first-seen order; mutually exclusive with color. Left empty (the default), every point uses Theme.mark_color.
  • size: Optional point-size channel. Left empty (the default), every point uses Theme.point_radius.
  • theme: Full styling knobs beyond this function’s own parameters (colors, margins, fonts, gridlines, …) – see Theme’s docstring.
  • width: Pixel width of the returned Plot (.size()).
  • height: Pixel height of the returned Plot (.size()).
  • title: The chart’s title, shown above the plot.
  • subtitle: A secondary line shown under the title.
  • x_title: The x-axis caption.