You are on page 1of 5

ggplot2 3.4.

LINKS

View on CRAN
Browse source
ggplot2 code
Report a bug
Learn more
Extensions

Overview LICENSE

ggplot2 is a system for declaratively creating graphics, based Full license


on The Grammar of Graphics. You provide the data, tell MIT + file LICENSE
ggplot2 how to map variables to aesthetics, what graphical
primitives to use, and it takes care of the details. COMMUNITY

Contributing
Installation guide
Code of conduct
# The easiest way to get ggplot2 is to install the w
install.packages("tidyverse") C I T AT I O N

Citing ggplot2
# Alternatively, install just ggplot2:
install.packages("ggplot2")
DEVELOPERS
# Or the development version from GitHub:
# install.packages("pak") Hadley
ggplot2
pak::pak("tidyverse/ggplot2")
3.4.4 Wickham
Author 

Winston Chang
Cheatsheet Author 

Lionel Henry
Author

Thomas Lin
Pedersen
Author,
maintainer 

Kohske
Takahashi
Author
Usage Claus Wilke
Author 
It’s hard to succinctly describe how ggplot2 works because it
embodies a deep philosophy of visualisation. However, in Kara Woo
most cases you start with ggplot() , supply a dataset and Author 
aesthetic mapping (with aes() ). You then add on layers (like Hiroaki Yutani
geom_point() or geom_histogram() ), scales (like Author 
scale_colour_brewer() ), faceting specifications (like Dewey
facet_wrap() ) and coordinate systems (like Dunnington
coord_flip() ). Author 

library(ggplot2) Copyright holder,


funder
ggplot(mpg, aes(displ, hwy, colour = class)) +
ggplot2
geom_point()
3.4.4

Lifecycle
lifecycle stable

ggplot2 is now over 10 years old and is used by hundreds of


thousands of people to make millions of plots. That means,
by-and-large, ggplot2 itself changes relatively little. When we
do make changes, they will be generally to add new functions
or arguments rather than changing the behaviour of existing
functions, and if we do make changes to existing behaviour
we will do them for compelling reasons.
If you are looking for innovation, look to ggplot2’s rich
ggplot2
ecosystem3.4.4
of extensions. See a community maintained list at
https://exts.ggplot2.tidyverse.org/gallery/.

Learning ggplot2
If you are new to ggplot2 you are better off starting with a
systematic introduction, rather than trying to learn from
reading individual documentation pages. Currently, there are
three good places to start:

1. The Data Visualisation and Graphics for communication


chapters in R for Data Science. R for Data Science is
designed to give you a comprehensive introduction to the
tidyverse, and these two chapters will get you up to speed
with the essentials of ggplot2 as quickly as possible.

2. If you’d like to take an online course, try Data Visualization


in R With ggplot2 by Kara Woo.

3. If you’d like to follow a webinar, try Plotting Anything with


ggplot2 by Thomas Lin Pedersen.

4. If you want to dive into making common graphics as


quickly as possible, I recommend The R Graphics
Cookbook by Winston Chang. It provides a set of recipes to
solve common graphics problems.
If you’ve mastered the basics and want to learn more, read
ggplot2 3.4.4 Graphics for Data Analysis. It describes the
ggplot2: Elegant
theoretical underpinnings of ggplot2 and shows you how all
the pieces fit together. This book helps you understand the
theory that underpins ggplot2, and will help you create new
types of graphics specifically tailored to your needs.

Getting help
There are two main places to get help with ggplot2:

1. The RStudio community is a friendly place to ask any


questions about ggplot2.

2. Stack Overflow is a great source of answers to common


ggplot2 questions. It is also a great place to get help, once
you have created a reproducible example that illustrates
your problem.

Developed by Hadley Wickham, Winston Chang, Lionel Henry, Thomas Lin Site built with
Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, Dewey pkgdown
Dunnington, . 2.0.7.

You might also like