如何在ggplot中表示boxplots的离群值频率?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在ggplot中表示boxplots的离群值频率?相关的知识,希望对你有一定的参考价值。
它们是用这段代码生成的
my_xlab <- paste(levels(adpt_info$age_class),"
(N=",table(adpt_info$age_class),")",sep="")
ggplot(adpt_info, aes(x=age_class, y=nr_trips)) +
geom_boxplot(varwidth = TRUE, alpha=0.2)+
scale_x_discrete(labels=my_xlab)+
stat_summary(fun.data = "mean_cl_normal",
aes(shape="mean"),
size=4,
colour = "red",
geom="point") +
scale_shape_manual("", values=c("mean"="x"))+
theme_minimal()
正如你所看到的,博平图有一个... ... alpha
值,它应该表明有多少个相同值的离群值出现。该 nr_trips
是整数值。
我想做的是在图上添加一个α值的图例,或者用不同的方式来表示出现的情况。像这样,在我看来,它不能很好地显示分布的差异。
谢谢您的帮助
数据摘录。
structure(list(age_class = structure(c(4L, 6L, 3L, 6L, 5L, 3L,
7L, 4L, 4L, 7L, 7L, 6L, 6L, 7L, 7L, 5L, 1L, 6L, 3L, 5L, 5L, 2L,
4L, 4L, 3L, 5L, 1L, 8L, 7L, 9L, 9L, 4L, 4L, 3L, 2L, 6L, 2L, 1L,
5L, 8L, 8L, 7L, 4L, 4L, 9L, 9L, 8L, 4L, 4L, 6L, 6L, 5L, 5L, 8L,
4L, 6L, 7L, 5L, 1L, 1L, 5L, 4L, 5L, 4L, 3L, 3L, 4L, 4L, 7L, 7L,
6L, 5L, 2L, 5L, 3L, 5L, 4L, 1L, 6L, 6L, 3L, 6L, 1L, 1L, 5L, 8L,
4L, 4L, 6L, 7L, 3L, 2L, 6L, 2L, 3L, 3L, 4L, 1L, 2L, 2L, 6L, 5L,
5L, 5L, 4L, 4L, 6L, 3L, 3L, 5L, 5L, 7L, 4L, 1L, 3L, 4L, 1L, 5L,
6L, 5L, 4L, 4L, 4L, 5L, 5L, 6L, 5L, 7L, 3L, 2L, 7L, 4L, 5L, 4L,
4L, 8L, 3L, 7L, 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, 2, 2, 2, 5, 2,
2, 5)), row.names = c(NA, 3000L), class = "data.frame")
答案
你可以添加 geom_jitter
来显示离群值(改编自本帖(使用ggplot2对boxplot中的离群值数据进行抖动处理。):
my_xlab <- paste(levels(df$age_class),"
(N=",table(df$age_class),")",sep="")
df %>%
group_by(age_class) %>%
mutate(outlier = nr_trips > median(nr_trips) + IQR(nr_trips) * 1.5) %>%
ggplot(aes(x=age_class, y=nr_trips)) +
geom_boxplot(varwidth = TRUE, outlier.shape = NA)+
scale_x_discrete(labels=my_xlab)+
stat_summary(fun.data = "mean_cl_normal",
aes(shape="mean"),
size=4,
colour = "red",
geom="point") +
scale_shape_manual("", values=c("mean"="x"))+
theme_minimal() +
geom_jitter(data = function(x) dplyr::filter_(x, ~ outlier), width = 0.25, height = 0, alpha = .2, aes(color = "outliers")) +
scale_color_manual(name = "", values = c("outliers" = "black"))
以上是关于如何在ggplot中表示boxplots的离群值频率?的主要内容,如果未能解决你的问题,请参考以下文章
如何在 ggplot2 boxplot 中为每组添加多个观察值并使用组平均值?
R语言使用ggplot2包使用geom_boxplot函数绘制基础分组箱图(boxplot)实战
R语言使用ggplot2包使用geom_boxplot函数绘制基础分组水平箱图(boxplot)实战
R语言使用ggplot2包使用geom_boxplot函数绘制基础分组缺口箱图(notch boxplot)实战
R语言ggplot2可视化箱图(boxplot)自定义设置抑制箱图中异常值数据点的输出(removes boxplot outliers in the ggplot2 graph)