我试图通过索引(PASS
或FAIL
在本例中)在我的山脊图上显示点。但是当我这样做时,我最终每组有两个山脊。我想知道如何每组只有一个山脊?
我的代码,以及下面的输出图像:
library(ggplot2)
library(ggridges)
library(scales)
ggplot(dataSet, aes(x = `Vector_fails`, y = Group, fill = Group)) +
geom_density_ridges(alpha = .1,
point_alpha = 1,
jittered_points = TRUE,
aes(point_color = PassCode)) +
labs(title = 'Vector_fails') +
scale_x_log10(limits = c(0.09, 1000000),
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x))) +
annotation_logticks(sides="b")