Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Grammar of Graphics for Kotlin

License

NotificationsYou must be signed in to change notification settings

JetBrains/lets-plot-kotlin

Repository files navigation

AGrammar of Graphics for Kotlin.

official JetBrains projectLicense MITLatest Release

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.

book cover

Lets-PlotKotlin API is largely based on the API
provided byggplot2 package well-known to data scientists who use R.

To learn more about theGrammar 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.

Quickstart

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)

Couldn't load quickstart_notebook.png


See the "Quickstart" notebook inDatalore orJupyter nbviewer.

Table of Contents

Usage

Notebooks

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.

"Line Magics"

%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.

Library Descriptor Parameters

%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).

Compose Multiplatform

To learn how to embed Lets-Plot charts inCompose Multiplatform applications, please check out theLets-Plot Skia Frontend project.

JVM and Kotlin/JS

To learn more about creating plots in JVM or Kotlin/JS environment please readUSAGE_SWING_JFX_JS.md.

Examples

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.

Documentation

What is new in 4.10.0

Recent Updates in theGallery

Creating magnifier inset effect with ggbunch()Customize legend appearanceZoom and Pan interactivityThe observable LP-verseSunshine hoursUnemployment in the US since 1967

Change Log

SeeCHANGELOG.md.

Code of Conduct

This project and the corresponding community are governed by theJetBrains Open Source and Community Code of Conduct.Please make sure you read it.

License

Code and documentation released undertheMIT license.Copyright © 2019-2025, JetBrains s.r.o.


[8]ページ先頭

©2009-2025 Movatter.jp