geom_flat_violin function

Half violin plot

Half violin plot

Source

urlhttps://gist.github.com/dgrtwo/eb7750e74997891d7c20

geom_flat_violin( mapping = NULL, data = NULL, stat = "ydensity", position = "dodge", trim = TRUE, scale = "area", show.legend = NA, inherit.aes = TRUE, ... )

Arguments

  • mapping: The mapping
  • data: data.frame
  • stat: statistic (don't change)
  • position: position dodge
  • trim: Logical
  • scale: Scale (don't change)
  • show.legend: Logical
  • inherit.aes: Logical
  • ...: other arguments

Returns

A layer for a ggplot2::ggplot object, similar to e.g. ggplot2::geom_violin.

Examples

library(ggplot2) data(diamonds) ggplot(diamonds, aes(cut, carat)) + geom_flat_violin() + coord_flip()

See Also

ggplot2::geom_violin(), which provided the basis of this function.