Get Started
A Grammar of Graphics for Kotlin.
Lets-Plot Kotlin API is a Kotlin API for Lets-Plot Multiplatform plotting library, which is built on the principles of layered graphics first described in the Leland Wilkinson work The Grammar of Graphics.
Lets-Plot Kotlin API is largely based on the API To learn more about the Grammar of Graphics, This will be a good prerequisite for further exploration of the Lets-Plot library. |
---|
Quick Start
Inside Kotlin Notebook, Datalore or Jupyter with Kotlin Kernel:
%use lets-plot
val rand = java.util.Random(37)
val data = mapOf (
"rating" to List(200) { rand.nextGaussian() } + List(200) { rand.nextGaussian() * 1.5 + 1 },
"cond" to List(200) { "A" } + List(200) { "B" }
)
letsPlot(data) { x = "rating"; fill = "cond" } + ggsize(700, 300) +
geomDensity(color = "dark_green", alpha = .7) + scaleFillBrewer(type = "seq") +
theme(panelGridMajorX = "blank")
You can read more about running Lets-Plot for Kotlin in notebooks and on different platforms here.
Last modified: 20 August 2024