2012-04-07 98 views
1

我有一个数据,我想绘制累积函数。在R曲线中绘制对数()

的R代码里面我有如下:

dat <- read.table("evalues_point.txt") 
pre.test <- dat$V1 
print (pre.test) 

pre.ecdf <- ecdf(pre.test) 
rx <- range(pre.test) 
ry <- max(length(pre.test)) 


curve(length(pre.test)*(1-pre.ecdf(x)), from=rx[1], to=rx[2], col="red", xlim=rx, ylim=c(0,ry)) 

随着我的代码当前情节看起来像这样(没有数标度)。 我该如何修改我的代码,使其在Y轴上绘制对数刻度?

的数据可以下载here

enter image description here

+0

我搜索了“r对数刻度”与谷歌和结束在http://stackoverflow.com/questions/1245273/histogram-with-logarithmic-scale,https://stat.ethz.ch/pipermail/r- help/2007-November/146367.html或其他... – phimuemue 2012-04-07 08:34:54

+0

当你知道数据集很大时,我真的认为你应该放弃'print(dat)'。应该改用'print(head(dat))'和'summary(dat)'。 – 2012-04-07 12:33:20

回答

3

您可以将参数log = "y"添加到通话,但你必须从零改变最小程度的东西更高。有关此参数的详细信息,请参阅?plot.default,该参数从curve开始传递。