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
Basic Building Blocks
Points: points
, jittered points
Lines: line
, path
, diagonal line
, horizontal line
, vertical line
, segment
, curve
, spoke
, step-function
Tiles: tiles
, rectangles
, raster plot
Text: text
, text repel
, label
, label repel
Examples:
Discrete
bar
, pie
, lollipop
, boxplot
, count
/sum
Learn more: Working with Categorical Variables and the asDiscrete() Function
Examples:
Contours
Examples:
Visualization of Distribution
histogram
, density
, dotplot
, y-dotplot
, violin
, sina
, ridgeline
, frequency polygon
Examples:
Stats
statECDF()
, statSummary()
, statSummaryBin()
Examples:
Function
Examples:
Visualization of Errors
crossbar
, errorbar
, linerange
, pointrange
Examples:
Smoothing
Examples:
Bivariate Distribution
2d bins
, 2d hexagonal bins
, 2d density
, filled 2d density
Examples:
Marginal Plots
See also: Joint Plot, Residual Plot.
Examples:
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
Examples:
Images
Examples:
Coordinate Systems
coordCartesian()
, coordFixed()
, coordPolar()
, coordFlip()
, coordMap()
Examples:
Legends and Guides
guideLegend()
, guideColorbar()
, guides()
, layerKey()
Examples: