0

我想显示一些 CDF 数据(R 代码如下),通过在 X 轴上使用一组数字 BREAKS 以彼此相等的距离显示(尽管在数字上,BREAKS 在 log10 轴上并且不反射相等的距离):

df <- data.frame(
  x = c(rnorm(100, 0, 3), rnorm(100, 0, 10)),
  g = gl(2, 100)
)

breaks=c(0.001, 0.01, 0.1, 1, 5, 10, 20, 30, 100)

ggplot(df, aes(x, colour = g)) + 
stat_ecdf()  + 
scale_x_log10(breaks=breaks), 

我该怎么做?

4

1 回答 1

0

最后,我使用了以下 R 代码:

ggplot(df, aes(x, colour = g)) + stat_ecdf() +   
scale_x_log10(breaks=breaks, limits=c(0.001, 1000)) +  
theme(axis.text.x = element_text(size=8, angle=45)) + 
labs(title="", y ="", x="PR") +
theme_classic()
于 2018-12-17T20:25:56.003 回答