- Notifications
You must be signed in to change notification settings - Fork38
Grammar of Graphics for Kotlin
License
JetBrains/lets-plot-kotlin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AGrammar of Graphics for Kotlin.
Lets-Plot Kotlin API is aKotlin API forLets-Plot Multiplatformplotting library,
which is built on the principles of layered graphics first described in the
Leland Wilkinson workThe Grammar of Graphics.
![]() | Lets-PlotKotlin API is largely based on the API To learn more about theGrammar of Graphics, This will be a good prerequisite for further exploration of the Lets-Plot library. |
InsideKotlin Notebook,Datalore orJupyter with Kotlin Kernel:
%use lets-plot
val rand= java.util.Random()val data=mapOf("rating" toList(200) { rand.nextGaussian() }+List(200) { rand.nextGaussian()*1.5+1.5 },"cond" toList(200) {"A" }+List(200) {"B" })var p= letsPlot(data)p+= geomDensity(color="dark_green", alpha= .3) { x="rating"; fill="cond" }p+ ggsize(700,350)
See the "Quickstart" notebook inDatalore orJupyter nbviewer.
- Usage
- Documentation
- What is new in 4.10.0
- Recent Updates in the Gallery
- Change Log
- Code of Conduct
- License
With the help of Lets-Plot Kotlin API you can easily create plots inKotlin Notebook,Datalore,Jupyter with Kotlin Kernel
or any other notebook that supportsKotlin Kernel
.
%use lets-plot
This "line magic" will applyLets-Plot library descriptor which adds to your notebook all the boilerplate code necessary to create plots.
By default,library descriptor
is bundled with the Kotlin Jupyter Kernel installed in your environment.
However, you can override the default settings using:
%useLatestDescriptors
In this case the latestlibrary descriptor
will be pulled from theKotlin Jupyter Libraries repository.
%use lets-plot(v=4.10.0, isolatedFrame=false)
v
- version of the Lets-Plot Kotlin API.isolatedFrame
- Iffalse
: load JS just once per notebook (default in Jupyter).Iftrue
: include Lets-Plot JS in each output (default inDatalore notebooks).
To learn how to embed Lets-Plot charts inCompose Multiplatform applications, please check out theLets-Plot Skia Frontend project.
To learn more about creating plots in JVM or Kotlin/JS environment please readUSAGE_SWING_JFX_JS.md.
Examples of using of the Lets-Plot Kotlin API in JVM and Kotlin/JS applications are available in theLets-Plot Kotlin Mini Apps (Demos) GitHub repository.
Lets-Plot Kotlin API documentation and API reference:Lets-Plot for Kotlin
A quick introduction to theGrammar of Graphics andLets-Plot Kotlin API:Lets-Plot Usage Guide
Seeexample notebook.
See examples:multiline axis labels,axis label justification.
Seeexample notebook.
It replaces the deprecated
GGBunch
class.Seeexample notebook.
Seeexample notebook.
Seeexample notebook.
SeeCHANGELOG.md for a full list of changes.
Recent Updates in theGallery






SeeCHANGELOG.md.
This project and the corresponding community are governed by theJetBrains Open Source and Community Code of Conduct.Please make sure you read it.
Code and documentation released undertheMIT license.Copyright © 2019-2025, JetBrains s.r.o.
About
Grammar of Graphics for Kotlin