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
labelsparameter. Pass the result of thelayerLabels()call to configure the label content and layout.Annotations for
geomSmooth(). Use thelabelsparameter together withsmoothLabels()to display statistics computed by thesmoothstat (for example, R², adjusted R², and a fitted model equation).smoothLabelsextendslayerLabels, so formatting and text template helpers work the same way.Bracket annotations. Use
geomBracket()to add labeled brackets highlighting relationships between categories or marking an interval. UsegeomBracketDodge()to draw brackets that connect dodged groups within each category (e.g., comparisons inside grouped boxplots/bars).
See also the formatting reference to learn how to format numeric and date-time values in annotations.