Parallel Coordinates
Parallel Coordinates
A parallel-coordinates chart.
Usage
from dataviz_mojo import parallel
from dataviz_mojo.plot import save
def main() raises:
var dims: List[String] = ["Horsepower", "MPG", "Weight (100 lbs)", "0-60 (sec)", "Price ($k)"]
var row_names: List[String] = ["Sedan", "SUV", "Sports Car"]
var data: List[List[Float64]] = [
[180.0, 32.0, 30.0, 8.5, 28.0],
[280.0, 22.0, 45.0, 6.5, 42.0],
[450.0, 16.0, 34.0, 3.5, 85.0],
]
var c = parallel(data, dims, row_names)
save(c, "docs/src/examples/out_parallel.svg")Args:
data:data[row]isrow_names[row]’s polyline, one value perdimsentry.dims: One vertical axis per entry, each independently scaled to its own column’s[min, max]acrossdata.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, …) – seeTheme’s docstring.width: Pixel width of the returnedPlot(.size()).height: Pixel height of the returnedPlot(.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.