【发布时间】:2020-12-24 15:23:14
【问题描述】:
我有DF data.frame。我想使用DF 中的variables 的plot 和cumulative distribution function (CDF) 使用ggplot。使用以下代码生成plot,但由于variables 的数据范围很大,我看不到plot。我不想使用multiple facets- 想在single panel 上拥有所有variables plotted。
library(ggplot2)
set.seed(123)
DF <- melt(data.frame(p1 = runif(200,1,10), p2 = runif(200,-2,1), p3 = runif(200,0,0.05),p4 = runif(200,100,4000)))
ggplot(DF, aes(x = value, col = variable))+
stat_ecdf(lwd = 1.2)
【问题讨论】:
-
分面是显而易见的解决方案,但设置 alpha 可能会有所帮助
标签: r dataframe ggplot2 cdf ecdf