【问题标题】:Plotting Logscale in R's curve()在 R 的曲线()中绘制对数刻度
【发布时间】:2012-04-20 15:10:42
【问题描述】:

我有一个数据要绘制在累积函数中。

我的 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

【问题讨论】:

标签: r plot


【解决方案1】:

您可以将参数log = "y" 添加到调用中,但您必须将最小范围从零更改为更高的值。有关此参数的详细信息,请参阅 ?plot.default,该参数是从 curve 传递的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-15
    • 1970-01-01
    • 2015-09-25
    • 2019-06-12
    • 1970-01-01
    • 2015-11-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多