【发布时间】:2020-05-12 03:16:24
【问题描述】:
我正在尝试通过索引(在本例中为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")
【问题讨论】:
-
您能否提供一个可重现的小代码示例?见:stackoverflow.com/questions/5963269/…
标签: r ggplot2 ggridges ridgeline-plot