Description Usage Arguments Examples
Side by side vase plots.
1 2 3 |
mapping |
Set of aesthetic mappings created by |
data |
A data frame. If specified, overrides the default data frame defined at the top level of the plot. |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_vase()
qplot(factor(cyl), mpg, data = mtcars, geom = "vase")
p + geom_vase() + geom_jitter(height = 0)
p + geom_vase() + coord_flip()
qplot(factor(cyl), mpg, data = mtcars, geom = "vase") +
coord_flip()
# Scale maximum width proportional to sample size:
p + geom_vase(scale = "count")
# Scale maximum width to 1 for all violins:
p + geom_vase(scale = "width")
# Use a smaller bandwidth for closer density fit (default is 1).
p + geom_vase(adjust = .5)
# Add aesthetic mappings
# Note that vases are automatically dodged when any aesthetic is
# a factor
p + geom_vase(aes(fill = cyl))
p + geom_vase(aes(fill = factor(cyl)))
p + geom_vase(aes(fill = factor(vs)))
p + geom_vase(aes(fill = factor(am)))
# Set aesthetics to fixed value
p + geom_vase(fill = "grey80", colour = "#3366FF")
qplot(factor(cyl), mpg, data = mtcars, geom = "vase",
colour = I("#3366FF"))
x <- rnorm(2000)
group <- rep(1:20, 100)
y <- rep(c(1,2),1000)
qplot(y,x,facets=~group, fill=factor(y), geom="vase")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.