我想绘制概率密度函数和伽马,对数正态,指数和帕累托分布的累积分布函数。我想改变参数,并在同一图中有2-3个不同参数的图。它应该看起来像这样(例子weibull分布):
library(Cairo)
CairoFonts(regular="DejaVu Sans:style=Regular")
CairoSVG("Weibull PDF.svg")
par(mar=c(3, 3, 1, 1))
x <- seq(0, 2.5, length.out=1000)
plot(x, dweibull(x, .5), type="l", col="blue", xlab="", ylab="", xlim=c(0, 2.5), ylim=c(0, 2.5), xaxs="i", yaxs="i")
lines(x, dweibull(x, 1), type="l", col="red")
lines(x, dweibull(x, 1.5), type="l", col="magenta")
lines(x, dweibull(x, 5), type="l", col="green")
legend("topright", legend=paste("\u03bb = 1, k =", c(.5, 1, 1.5, 5)), lwd=1, col=c("blue", "red", "magenta", "green"))
dev.off()
和
library(Cairo)
CairoFonts(regular="DejaVu Sans:style=Regular")
CairoSVG("Weibull CDF.svg")
par(mar=c(3, 3, 1, 1))
x <- seq(0, 2.5, length.out=1000)
plot(x, pweibull(x, .5), type="l", col="blue", xlab="", ylab="", xlim=c(0, 2.5), ylim=c(0, 1), xaxs="i", yaxs="i")
lines(x, pweibull(x, 1), type="l", col="red")
lines(x, pweibull(x, 1.5), type="l", col="magenta")
lines(x, pweibull(x, 5), type="l", col="green")
legend("bottomright", legend=paste("\u03bb = 1, k =", c(.5, 1, 1.5, 5)), lwd=1, col=c("blue", "red", "magenta", "green"))
dev.off()
如何调整语法以将其用于其他发行版?