pdfPlot(distribution = "norm", param.list = list(mean = 0, sd = 1),
left.tail.cutoff = ifelse(is.finite(supp.min), 0, 0.001),
right.tail.cutoff = ifelse(is.finite(supp.max), 0, 0.001),
plot.it = TRUE, add = FALSE, n.points = 1000, pdf.col = "black",
pdf.lwd = 3 * par("cex"), pdf.lty = 1, curve.fill = !add,
curve.fill.col = "cyan", x.ticks.at.all.x.max = 15,
hist.col = ifelse(add, "black", "cyan"), density = 5,
digits = .Options$digits, ..., type = "l", main = NULL, xlab = NULL,
ylab = NULL, xlim = NULL, ylim = NULL)
distribution="norm"
. See the help file for Distribution.df
for a
list of possible distribution param.list=list(mean=0, sd=1)
. See the help file for
Distribution.df
for the names and possible0
0
; foadd
) on the current graphics device. If plot.it=FALSE
, no
plot is produced, but a list of $(x, y)$ values is returned (see the sectionadd=TRUE
), or to create a new plot
(add=FALSE
; the default). This argument is ignored if plot.it=FALSE
.n.points=1000
.pdf.col="black"
. See the entry for col
in the
help file for
pdf.lwd=3*par("cex")
.
See the entry for lwd
in the help file for
pdf.lty=1
. See the entry for
lty
in the help file for par<
curve.fill.col
.
The default value is TRUE
unless add=TRUE
curve.fill=TRUE
,
a numeric scalar or character string
indicating what color to use to fill in the
area below the probability density curve. The default value is
curve.fill.col="cyan"
x.ticks.at.all.x.max=15
.add=FALSE
, or the color
of the shading lines if add=TRUE
. The default is "cyan"
if
add=TRUE
. This argument is ignored if add=FALSE
.digits=.Options$digits
.plot.default
and
par
).pdfPlot
invisibly returns a list giving coordinates of the points
that have been or would have been plotted:Distribution.df
, epdfPlot
, cdfPlot
.# Plot the pdf of the standard normal distribution
#-------------------------------------------------
dev.new()
pdfPlot()
#==========
# Plot the pdf of the standard normal distribution
# and a N(2, 2) distribution on the sample plot.
#-------------------------------------------------
dev.new()
pdfPlot(param.list = list(mean=2, sd=2),
curve.fill = FALSE, ylim = c(0, dnorm(0)), main = "")
pdfPlot(add = TRUE, pdf.col = "red")
legend("topright", legend = c("N(2,2)", "N(0,1)"),
col = c("black", "red"), lwd = 3 * par("cex"))
title("PDF Plots for Two Normal Distributions")
#==========
# Clean up
#---------
graphics.off()
Run the code above in your browser using DataLab