
Package index • ggplot2
To create your own geoms, stats, scales, and facets, you’ll need to learn a bit about the object oriented system that ggplot2 uses. Start by reading vignette("extending-ggplot2") then consult …
Introduction to ggplot2
ggplot2 is an R package for producing visualizations of data. Unlike many graphics packages, ggplot2 uses a conceptual framework based on the grammar of graphics. This allows you to …
Create a new ggplot — ggplot • ggplot2
ggplot() initializes a ggplot object. It can be used to declare the input data frame for a graphic and to specify the set of plot aesthetics intended to be common throughout all subsequent layers …
Draw a function as a continuous curve — geom_function • ggplot2
Computes and draws a function as a continuous curve. This makes it easy to superimpose a function on top of an existing plot. The function is called with a grid of evenly spaced values …
ggplot2 - Create Elegant Data Visualisations Using the Grammar …
A system for declaratively creating graphics, based on "The Grammar of Graphics". You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and …
Construct aesthetic mappings — aes • ggplot2
Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Aesthetic mappings can be set in ggplot() and in individual layers.
Modify axis, legend, and plot labels — labs • ggplot2
See get_alt_text for examples. alt can also be a function that takes the plot as input and returns text as output. alt also accepts rlang lambda function notation.
Save a ggplot (or other grid object) with sensible defaults
ggsave() is a convenient function for saving a plot. It defaults to saving the last plot that you displayed, using the size of the current graphics device. It also guesses the type of graphics …
Lay out panels in a grid — facet_grid • ggplot2
You can use different labeling functions for different kind of labels, for example use label_parsed() for formatting facet labels. label_value() is used by default, check it for more details and …
Text — geom_label • ggplot2
When constructing a layer using a stat_*() function, the ... argument can be used to pass on parameters to the geom part of the layer. An example of this is stat_density(geom = "area", …