geom_rug {ggplot2} | R Documentation |
Marginal rug plots.
geom_rug(mapping = NULL, data = NULL, stat = "identity", position = "identity", sides = "bl", ...)
sides |
A string that controls which sides of the
plot the rugs appear on. It can be set to a string
containing any of |
mapping |
The aesthetic mapping, usually constructed
with |
data |
A layer specific dataset - only needed if you want to override the plot defaults. |
stat |
The statistical transformation to use on the data for this layer. |
position |
The position adjustment to use for overlappling points on this layer |
... |
other arguments passed on to
|
geom_rug
understands the following aesthetics (required aesthetics are in bold):
alpha
colour
linetype
size
p <- ggplot(mtcars, aes(x=wt, y=mpg)) p + geom_point() p + geom_point() + geom_rug() p + geom_point() + geom_rug(sides="b") # Rug on bottom only p + geom_point() + geom_rug(sides="trbl") # All four sides p + geom_point() + geom_rug(position='jitter')