4
我试图使用包poweRlaw绘制一些powerlaw适合。它似乎适用于单曲线。但我无法在同一个图上绘制多个图。 Ref:这个包里有没有办法? [P.S.我是新手]多个幂律图与包PoweRlaw
set.seed(1)
x1 <- ceiling(rlnorm(1000, 4))
x2 <- ceiling(rlnorm(1000, 2))
library(poweRlaw)
pl_d = pl_data$new(x1)
plot(pl_d)
#Now fit the powerlaw
m = displ$new(pl_d)
#Estimate the cut-off
#estimate_xmin(m)
aaa <- estimate_xmin(m)
aaa <- as.data.frame(aaa)
aaa <- aaa[2,1]
x_min <- min(table(x))
m$setXmin(aaa); m$mle()
#Plot the data and the PL line
#plot(m)
lines(m, col=2)
# next POWER LAW graph
#Plot the data
pl_d = pl_data$new(x2)
points(pl_d)
#Now fit the powerlaw
m = displ$new(pl_d)
#Estimate the cut-off
#estimate_xmin(m)
aaa <- estimate_xmin(m)
aaa <- as.data.frame(aaa)
aaa <- aaa[2,1]
x_min <- min(table(x))
m$setXmin(aaa); m$mle()
#Plot the data and the PL line
#points(m)
lines(m, col=3)
谢谢。将等待不同的“xmins”版本。 – 2013-02-26 01:35:18
那么,我真正想要绘制的是类似以下内容: ![FIGURE] – 2013-03-28 14:34:19
@AttuD查看更新后的答案。在将来的版本中,我可能会为plot函数添加一个参数以使其更容易。 – csgillespie 2013-03-28 21:06:18