SkillAgentSearch skills...

Ggannotate

Interactively annotate ggplots

Install / Use

/learn @MattCowgill/Ggannotate
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- README.md is generated from README.Rmd. Please edit that file -->

ggannotate <img src="man/figures/ggannotate_hex.png" align="right" height="138.5"/>

<!-- badges: start -->

Lifecycle:
stable R build
status Codecov test
coverage

<!-- badges: end -->

{ggannotate} makes it easy to add annotations to your {ggplot2} plots by pointing and clicking.

Annotations are often the most important part of a data visualisation, but getting them in exactly the right place can be fiddly.

{ggannotate} launches an interactive Shiny gadget that lets you click on your plot to place annotations exactly where you want them. It then generates the code to reproduce your annotations

Features

  • Add text, labels, curves, and rectangles to any ggplot2 plot
  • Place multiple annotations in a single session
  • Full support for faceted plots
  • Annotations using the same geom are combined into a single layer for cleaner code
  • Copy generated code to the clipboard with one click
  • Use as an RStudio addin or call directly from the console

Installation

Install the development version from GitHub:

# install.packages("pak")
pak::pak("MattCowgill/ggannotate")

Usage

Firs, create a ggplot2 object:

library(ggplot2)
library(ggannotate)

ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()

Then just call ggannotate() or use the handy RStudio addin to invoke ggannotate.

It also works with named plots:

p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()

ggannotate(p)

This launches a Shiny app where you can add your annotations interactively. When you’re done, click “Copy code” to copy the annotation code to your clipboard, then paste it into your script.

View on GitHub
GitHub Stars382
CategoryDevelopment
Updated3d ago
Forks24

Languages

R

Security Score

80/100

Audited on Mar 21, 2026

No findings