Scatter
Scatter
A scatter plot.
Usage
from dataviz_mojo import scatter
from dataviz_mojo.plot import save
def main() raises:
var x: List[Float64] = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
var y: List[Float64] = [2.3, 4.1, 3.6, 5.8, 5.1, 7.4, 6.9, 8.2, 9.0, 8.6]
var c = scatter(x, y)
save(c, "docs/src/examples/out_scatter.svg")Args:
x: The continuous x column, one entry per point.y: The continuous y column, one entry per point.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.x_title: The x-axis caption.y_title: The y-axis caption.