Lets-Plot for Kotlin 4.12.0 Help

Charts

Data

Every layer may have some data associated with it. The "data" refers to a table of data where each row contains an observation and each column represents a variable that describes some property of each observation.

Data in this format is sometimes referred to as tidy data, flat data, primary data, atomic data, and unit record data.

You can pass tidy data to Lets-Plot in form of a Kotlin Map.

Aesthetics

Cookbooks:

Basic Building Blocks

Points: points, jittered points

Lines: line, path, diagonal line, horizontal line, vertical line, segment, curve, spoke, step-function

Areas: area, band, ribbon

Polygons: polygon, map

Tiles: tiles, rectangles, raster plot

Text: text, text repel, label, label repel

Cookbooks:

Demos:

Discrete

bar, pie, lollipop, boxplot, count/sum

Learn more: Working with Categorical Variables and the asDiscrete() Function

Cookbooks:

Contours

contours, filled contours

Cookbooks:

Visualization of Distribution

histogram, density, dotplot, y-dotplot, violin, sina, ridgeline, frequency polygon

Cookbooks:

Stats

statECDF(), statSummary(), statSummaryBin()

Cookbooks:

Function

function

Cookbooks:

Visualization of Errors

crossbar, errorbar, linerange, pointrange

Cookbooks:

Smoothing

smoothing line

Cookbooks:

Bivariate Distribution

2d bins, 2d hexagonal bins, 2d density, filled 2d density, pointdensity

Cookbooks:

Marginal Plots

ggmarginal

See also: Joint Plot, Residual Plot.

Cookbooks:

Time Series

scaleXDatetime(), scaleYDatetime(), scaleXTime(), scaleYTime()

Lets-Plot handles all temporal data types through a unified "datetime" scale (excluding duration, which is handled by the "time" scale). This is in contrast to R's ggplot2, which provides separate "date", "time", and "datetime" scales.

Supported temporal data types:

  • kotlinx.datetime library:

    • Instant

    • LocalDate

    • LocalTime

    • LocalDateTime

  • java.time package:

    • Instant

    • LocalDate

    • LocalTime

    • LocalDateTime

    • ZonedDateTime (timezone-aware)

    • OffsetDateTime (timezone-aware with offset)

  • java.util package:

    • Date

Cookbooks:

Demos:

Images

geomImshow()

Cookbooks:

Coordinate Systems

coordCartesian(), coordFixed(), coordPolar(), coordFlip(), coordMap()

Cookbooks:

Legends and Guides

guideLegend(), guideColorbar(), guides(), layerKey()

Cookbooks:

14 November 2025