Functional Line Plot
val xs = (-2000..2000).map { it / 500.0f }
val function = { x: Float -> sin(x) * cos(x * 2 + 1) * sin(3 * x + 2) }
val ys = xs.map(function)
plot {
line {
x(xs)
y(ys) {
scale = continuous(-1.0f..1.0f)
}
hLine {
yIntercept.constant(0.0)
color = Color.RED
type = LineType.DASHED
}
}
}
Last modified: 23 November 2023