Git Product home page Git Product logo

ggannotate's Introduction

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 <- ggplot(mtcars, 
            aes(x = wt, y = mpg)) + 
  geom_point() 

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.

ggannotate's People

Contributors

mattcowgill avatar jhelvy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.