
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 …
ggplot2 - Create Elegant Data Visualisations Using the Grammar …
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 …
Package index - ggplot2
All ggplot2 plots begin with a call to ggplot(), supplying default data and aesthetic mappings, specified by aes(). You then add layers, scales, coords and facets with +.
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 …
Complete themes — ggtheme • ggplot2
The classic dark-on-light ggplot2 theme. May work better for presentations displayed with a projector. theme_linedraw() A theme with only black lines of various widths on white …
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.
Colour related aesthetics: colour, fill, and alpha - ggplot2
Run vignette("ggplot2-specs") to see an overview of other aesthetics that can be modified. Other aesthetics documentation: aes (), aes_group_order, aes_linetype_size_shape, aes_position
Points — geom_point • ggplot2
If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot(). A data.frame, or other object, will override the plot data.
Bar charts — geom_bar • ggplot2
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 …
Save a ggplot (or other grid object) with sensible defaults
if (FALSE) { # \dontrun{ ggplot (mtcars, aes (mpg, wt)) + geom_point () # here, the device is inferred from the filename extension ggsave("mtcars.pdf") ggsave("mtcars.png") # setting …