Histogram Grouped

Edit pageLast modified: 06 December 2023
val random = java.util.Random(42)

val sampleA = List(1000) { random.nextGaussian() * 0.7 + 2.0 }
val sampleB = List(1000) { random.nextGaussian() * 1.4 + 3.5 }

val df = dataFrameOf(
    "sample" to sampleA + sampleB,
    "group" to sampleA.map { "A" } + sampleB.map { "B" }
)

df.groupBy("group").plot {
    histogram("sample")
}
Histogram Grouped