Lets-Plot for Kotlin 4.13.0 Help

Annotating Charts

Lets-Plot provides several ways to annotate charts:

  • Label annotations for geometry layers. Some geoms (such as pie, bar, and crossbar) support built-in text labels via the labels parameter. Pass the result of the layerLabels() call to configure the label content and layout.

    Learn more (reference notebook).

  • Annotations for geomSmooth(). Use the labels parameter together with smoothLabels() to display statistics computed by the smooth stat (for example, R², adjusted R², and a fitted model equation). smoothLabels extends layerLabels, so formatting and text template helpers work the same way.

    Learn more (reference notebook).

  • Bracket annotations. Use geomBracket() to add labeled brackets highlighting relationships between categories or marking an interval. Use geomBracketDodge() to draw brackets that connect dodged groups within each category (e.g., comparisons inside grouped boxplots/bars).

    Learn more (reference notebook).

See also the formatting reference to learn how to format numeric and date-time values in annotations.

Examples

20 March 2026