4.15 Lab: Labels & Annotations (1)

  • Labels
    • geom_text(): Add text, e.g., labels as in Figure 4.5
  • Annotations
    • geom_text(): Add text descriptions or to label points
      • Most plots won’t benefit from labelling every observation, but labeling outliers/important points is useful
    • geom_rect(): to highlight interesting rectangular regions of the plot
      • has aesthetics xmin, xmax, ymin and ymax
    • geom_line(), geom_path() and geom_segment(): Add lines
    • geom_vline(), geom_hline() and geom_abline(): Add reference lines
    • annotate(): Annotate text in textbox
Labels and annotations

Figure 4.5: Labels and annotations