Need help with ggannotate?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

MattCowgill
240 Stars 13 Forks Other 142 Commits 5 Opened issues

Description

Interactively annotate ggplots

Services available

!
?

Need anything else?

Contributors list

# 408,360
R
120 commits
# 488,293
HTML
Shell
R
3 commits

ggannotate

Lifecycle:
experimental R build
status Codecov test
coverage CRAN
status

{ggannotate} is a point-and-click tool to help you put your annotations exactly where you want them to go on your {ggplot2} plots.

The last step in data visualisation - adding annotations - is one of the most important, but it can be hard to get annotations in exactly the right place. With {ggannotate}, you interactively annotate ggplots using a Shiny-based RStudio add-in.

Installation

{ggannotate} is not yet on CRAN. It will be submitted to CRAN when it is more stable and feature-complete.

Install from GitHub:

remotes::install_github("mattcowgill/ggannotate")

Usage

Create a ggplot2 object, then call

ggannotate()
:
library(ggplot2)
library(ggannotate)

p

If you invoke

ggannotate()
without specifying a plot, it will use the last plot you modified or created, using
ggplot2::last_plot()
:
ggplot(mtcars, 
            aes(x = wt, y = mpg)) + 
  geom_point() 

ggannotate()

You can also use the RStudio add-in to annotate your

last_plot()
with
ggannotate()
.

Each of these options will launch a Shiny app. Add your annotation(s) and click ‘copy code’ to copy the annotation code to the clipboard. Then paste the copied code in your script and you’re done!

You can adjust the size of the plot in the Shiny app so you can set it to be the same as your intended output.

Lifecycle

Lifecycle:
experimental

{ggannotate} is still in active development, in an experimental phase. Aspects of the functionality are quite likely to change as the package evolves.

Suggestions are welcome (please file a GitHub issue). The UI will change substantially.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.