Skip to content
Parallel Coordinates

Parallel Coordinates

A parallel-coordinates chart, Alfred Inselberg’s format for visualizing many dimensions at once: one vertical axis per variable, connected by a line per row, for spotting clusters and correlations across more variables than a scatter plot could show.

Parallel Coordinates

Usage

from dataviz import parallel
from dataviz import save

def main() raises:
    # Illustrative EV specifications. Each axis is normalized
    # independently, exposing range/efficiency/cost tradeoffs.
    var dims: List[String] = [
        "Range (km)", "Efficiency (km/kWh)", "Charge (min)",
        "Cargo (L)", "Price ($k)",
    ]
    var row_names: List[String] = [
        "City", "Commuter", "Touring", "Crossover", "Utility", "Performance",
    ]
    var data: List[List[Float64]] = [
        [310.0, 6.4, 31.0, 310.0, 31.0],
        [430.0, 6.1, 28.0, 390.0, 39.0],
        [570.0, 5.6, 24.0, 440.0, 56.0],
        [485.0, 5.1, 32.0, 620.0, 52.0],
        [410.0, 4.4, 39.0, 880.0, 61.0],
        [455.0, 4.2, 19.0, 350.0, 92.0],
    ]

    var c = parallel(
        data,
        dims,
        row_names,
        title="Illustrative Electric-Vehicle Tradeoffs",
    )
    save(c, "docs/src/examples/out_parallel.svg")

See Data shapes for shared input conventions.

Args:

  • data: data[row] is row_names[row]’s polyline, one value per dims entry.
  • dims: One vertical axis per entry, each independently scaled to its own column’s [min, max] across data.
  • row_names: One polyline per entry, used as the legend key; required (not auto-numbered).
  • 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.
  • y_title: The y-axis caption.

Related

Related charts: Wind Barbs

Relevant API: parallel