Area
Area
An area chart.
Usage
from std.math import sin
from dataviz_mojo import area
from dataviz_mojo.plot import save
from dataviz_mojo.colors import STEELBLUE
from dataviz_mojo.theme import Theme
def main() raises:
var x = List[Float64]()
var y = List[Float64]()
for i in range(30):
var t = Float64(i) * 0.3
x.append(t)
y.append(sin(t) * 4.0 + 6.0)
var c = area(x, y, theme=Theme(mark_color=STEELBLUE))
save(c, "docs/src/examples/out_area.svg")Args:
x: The continuous x column, one entry per point.y: The continuous y column; the filled area runs from each point down to zero.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.