有没有办法忽略异常值geom_violin
y 轴图是否与 Q1 和 Q3 分位数相关? (range=1.5
以 R 为基数)。如果这可以自动化(即不只是调用特定的 y 轴限制),那就太好了。
我在这里看到使用 geom_boxplot 的解决方案:忽略 ggplot2 箱线图中的异常值 https://stackoverflow.com/questions/5677885/ignore-outliers-in-ggplot2-boxplot
但是有没有办法复制这种类型的解决方案geom_violin
?提前致谢!
下面的示例代码具有期望的结果
library(ggplot2)
Result <- as.numeric(c(.2, .03, .11, .05, .2, .02, .22, 1.1, .02, 120))
Group <- as.factor(c("a", "a", "a", "b", "b", "b", "c", "c", "c", "c"))
x <- data.frame(Result, Group)
plot = ggplot(x, aes(x=Group, y=Result)) +
geom_violin()
print(plot)
这是上面的输出(不是超级有用的图形):
I'd like something like the plot below using the above data: