Lets-Plot for Kotlin 4.9.2 Help

Get Started

A Grammar of Graphics for Kotlin.

JB Official License MIT Latest Release

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.

book cover

Lets-Plot Kotlin API is largely based on the API
provided by ggplot2 package well-known to data scientists who use R.

To learn more about the Grammar of Graphics,
we recommend an excellent book called
"ggplot2: Elegant Graphics for Data Analysis".

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")
Quick Start

NBViewer Datalore

You can read more about running Lets-Plot for Kotlin in notebooks and on different platforms here.

Last modified: 08 July 2024