r - How to use stat with geom_violin in ggplot2 -
i've been messing around geom_violin ggplot2. i'm able generate ugly plot shown below.
i think if apply log transformation or data, more clear.
in geom_violin documentation, noticed there parameter called stat. default, set ydensity. looking @ source code , not clear me transformations can pass function. know can find more documentation parameter?
in ggplot2
, stat
function applied data. stat="identity"
leaves data (say, plotting points). stat="bin"
bins data plotting histogram. stat="smooth"
creates regression smoother data. in case, stat="ydensity"
means geom_violin
default calculates kernel density creating violin plot.
if want violin plot of log of data, pass log(data) geom_violin
instead of data itself.
also, take @ the stat_summary
, allows apply own functions data , select geom
want use plot it.
Comments
Post a Comment