Jittered Points

Edit pageLast modified: 06 December 2023
val random = kotlin.random.Random(42)
val dataset = dataFrameOf(
    "type" to List(50) { "a" } + List(50) { "b" },
    "value" to List(50) { kotlin.random.Random.nextDouble(0.1, 0.6) } +
            List(50) { random.nextDouble(-0.5, 0.4) }
)

val type = column<String>("type")
val value = column<Double>("value")

dataset.plot {
    points {
        x(type)
        y(value)
        color(type)
        position = Position.jitter()
    }
}
Jittered Points