In [1]:
%useLatestDescriptors
%use lets-plot
LetsPlot.getInfo()
Out[1]:
Lets-Plot Kotlin API v.3.1.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.2.2.0.
In [2]:
val rand = java.util.Random()
val data = mapOf (
    "rating" to List(200) { rand.nextGaussian() } + List(200) { rand.nextGaussian() * 1.5 + 1.5 },
    "cond" to List(200) { "A" } + List(200) { "B" }
)

var p = letsPlot(data)
p += geomDensity(color="dark_green", alpha=.3) {x="rating"; fill="cond"}
p + ggsize(700, 350)
Out[2]: