ggannotate

by MattCowgill

MattCowgill /ggannotate

Interactively annotate ggplots

183 Stars 11 Forks Last release: Not found Other 116 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

ggannotate

Build
Status Lifecycle Codecov test
coverage CRAN
status

Overview

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

With ggannotate, you interactively annotate ggplots using a Shiny-based RStudio add-in.

Lifecycle

This package is still in an 'experimental' phase. Features are still being added, and the user interface has not yet been finalised. Feedback and suggestions are welcome, via GitHub issue or email to mattcowgill at gmail dot com.

Installation

Install from GitHub:

remotes::install_github("mattcowgill/ggannotate")

Usage

There are three ways to use

ggannotate
:
  1. Select some ggplot2 code in RStudio, then invoke the

    ggannotate
    addin via RStudio’s Addins menu.
  2. Create a ggplot2 object, then call

    ggannotate()
    , like this:
library(ggplot2)
p 
  1. Wrap some code that creates a ggplot2 object in
    ggannotate()
    , like

    this:

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

Each of these options will launch a Shiny app. Choose what type of annotation you want, click to place it in the right place, 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. You can keep repeat the process to add multiple annotations (this will get easier in later versions.)

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.