The function plotgg
plots the CDF and PDF of a given distribution object.
plotgg(x, which = "all", ...)# S3 method for contdist
plotgg(
x,
which = "all",
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1,
size2 = 1,
alpha1 = 0.7,
alpha2 = 0.7,
...
)
# S3 method for trans_contdist
plotgg(
x,
which = "all",
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1,
size2 = 1,
alpha1 = 0.7,
alpha2 = 0.7,
...
)
# S3 method for discrdist
plotgg(
x,
which = "all",
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PMF",
size1 = 3.3,
size2 = 3.3,
alpha1 = 0.9,
alpha2 = 0.9,
col_segment = "#b05e0b",
...
)
# S3 method for trans_discrdist
plotgg(
x,
which = "all",
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PMF",
size1 = 3.3,
size2 = 3.3,
alpha1 = 0.9,
alpha2 = 0.9,
col_segment = "#b05e0b",
...
)
# S3 method for contmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1,
size2 = 1,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
...
)
# S3 method for trans_contmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1,
size2 = 1,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
...
)
# S3 method for discrmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PMF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.9,
legend.position1 = "none",
legend.position2 = "none",
width = 0.25,
...
)
# S3 method for trans_discrmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PMF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.9,
legend.position1 = "none",
legend.position2 = "none",
width = 0.25,
...
)
# S3 method for contdiscrmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
...
)
# S3 method for trans_contdiscrmixdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
...
)
# S3 method for compdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
text_ylim = -0.01,
col_segment = "white",
lty_segment = 3,
lwd_segment = 1.8,
...
)
# S3 method for trans_compdist
plotgg(
x,
which = "all",
only_mix = FALSE,
pp1 = 1000,
pp2 = 1000,
col = "#F9D607",
xlim1 = q(x, c(0.01, 0.99)),
ylim1 = NULL,
xlim2 = xlim1,
ylim2 = NULL,
xlab1 = NULL,
ylab1 = NULL,
xlab2 = NULL,
ylab2 = NULL,
main1 = "CDF",
main2 = "PDF",
size1 = 1.6,
size2 = 1.6,
alpha1 = 0.4,
alpha2 = 0.4,
legend.position1 = "none",
legend.position2 = "none",
text_ylim = -0.01,
col_segment = "white",
lty_segment = 3,
lwd_segment = 1.8,
...
)
ggplot object if which = "cdf" or which = "pdf". If both are plotted, the plots are
merged using multiplot()
function and a list with both plots is invisibly returned.
distribution object.
whether to plot only CDF, PDF or both, default: 'all'.
further arguments to be passed.
number of points at which CDF is evaluated, default: 1000.
number of points at which PDF is evaluated, default: 1000.
color used in plot, default: '#122e94'.
xlim of CDF plot, default: q(x, c(0.01, 0.99)).
ylim of CDF plot, default: NULL.
xlim of PDF plot, default: xlim1.
ylim of PDF plot, default: NULL.
xlab of CDF plot, default: NULL.
ylab of CDF plot, default: NULL.
xlab of PDF plot, default: NULL.
ylab of PDF plot, default: NULL.
title of CDF plot, default: 'CDF'.
title of PDF plot, default: 'PDF'/'PMF'.
size used in CDF plot.
size used in PDF plot.
alpha used in CDF plot.
alpha used in PDF plot.
col of additional segment if contained in the plot (composite and discrete distributions).
whether to plot only mixture/composite model and not also the components, default: FALSE.
legend.position used in CDF plot.
legend.position used in PDF plot.
width of the bars that are used to plot discrete mixtures, default: 0.25.
y coordinate for text annotation, default: -0.01.
lty of additional segment if contained in the plot (composite and discrete distributions).
lwd of additional segment if contained in the plot (composite and discrete distributions).
if (FALSE) {
N <- normdist()
autoplot(N)
# manipulating cdf plot
B <- binomdist(12, 0.5)
autoplot(-3*B, which = "cdf", xlim1 = c(-30, -10))
# manipulating pdf plot
autoplot(-3*B, which = "pdf", xlim2 = c(-30, -10))
}
Run the code above in your browser using DataLab