geom_autopoint | R Documentation |
This geom is a specialisation of ggplot2::geom_point()
with two changes. It
defaults to mapping x
and y
to .panel_x
and .panel_y
respectively,
and it defaults to using position_auto()
to jitter the points based on the
combination of position scale types.
geom_autopoint(
mapping = NULL,
data = NULL,
stat = "identity",
position = "auto",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
facet_matrix for how to lay out scatterplot matrices and position_auto for information about the position adjustments
# Continuous vs continuous: No jitter
ggplot(mpg) + geom_autopoint(aes(cty, hwy))
# Continuous vs discrete: sina jitter
ggplot(mpg) + geom_autopoint(aes(cty, drv))
# Discrete vs discrete: disc-jitter
ggplot(mpg) + geom_autopoint(aes(fl, drv))
# Used with facet_matrix (x and y are automatically mapped)
ggplot(mpg) +
geom_autopoint() +
facet_matrix(vars(drv:fl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.