
ggplot2 - Create Elegant Data Visualisations Using the Grammar of …
ggplot2 is 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 it …
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 ‘speak’ a graph …
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 these functions …
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 aesthetic mappings for the plot, intended to be common throughout all subsequent …
Complete themes — ggtheme • ggplot2
Details theme_gray() The signature ggplot2 theme with a grey background and white gridlines, designed to put the data forward yet make comparisons easy. theme_bw() The classic dark-on-light ggplot2 …
A box and whiskers plot (in the style of Tukey) — geom_boxplot • …
Thus, ggplot2 will by default try to guess which orientation the layer should have. Under rare circumstances, the orientation is ambiguous and guessing may fail. In that case the orientation can …
Modify axis, legend, and plot labels — labs • ggplot2
Good labels are critical for making your plots accessible to a wider audience. Always ensure the axis and legend labels display the full variable name. Use the plot title and subtitle to explain the main …
Add components to a plot — add_gg • ggplot2
+ is the key to constructing sophisticated ggplot2 graphics. It allows you to start simple, then get more and more complex, checking your work at each step.
Text — geom_label • ggplot2
Aesthetics geom_text() understands the following aesthetics. Required aesthetics are displayed in bold and defaults are displayed for optional aesthetics: ... Learn more about setting these aesthetics in …
Points — geom_point • ggplot2
Aesthetics geom_point() understands the following aesthetics. Required aesthetics are displayed in bold and defaults are displayed for optional aesthetics: ... The fill aesthetic only applies to shapes 21-25. …