Last chance! 50% off unlimited learning
Sale ends in
sunflowerplot(x, ...)
"sunflowerplot"(x, y = NULL, number, log = "", digits = 6, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, add = FALSE, rotate = FALSE, pch = 16, cex = 0.8, cex.fact = 1.5, col = par("col"), bg = NA, size = 1/8, seg.col = 2, seg.lwd = 1.5, ...)
"sunflowerplot"(formula, data = NULL, xlab = NULL, ylab = NULL, ..., subset, na.action = NULL)
x
-coordinates of length n
,
say, or another valid plotting structure, as for
plot.default
, see also xy.coords
.y
-coordinates of length n
.n
. number[i]
= number
of replicates for (x[i], y[i])
, may be 0.
Default (missing(number)
): compute the exact multiplicity of
the points x[], y[]
, via
xyTable()
.plot.default
.number
is computed (i.e., not specified),
x
and y
are rounded to digits
significant
digits before multiplicities are computed.numeric(2)
limiting the extents of the x-,
or y-axis.FALSE
.TRUE
, randomly rotate the
sunflowers (preventing artefacts).number[i]==1
) and center of sunflowers.pch
).cex / cex.fact
is used for these.plot.default
.par(col=)
;
col = "gold"
reminds of real sunflowers.plot
[if
add = FALSE
], or to be passed to or from another method.formula
, such as y ~ x
.formula
should be taken.NA
s. The default is to ignore case
with missing values.xyTable()
(from package
grDevices) if you are only interested in this return value.
For number[i] == 1
, a (slightly enlarged) usual plotting symbol
(pch
) is drawn. For number[i] > 1
, a small plotting
symbol is drawn and number[i]
equi-angular ‘rays’
emanate from it.
If rotate = TRUE
and number[i] >= 2
, a random direction
is chosen (instead of the y-axis) for the first ray. The goal is to
jitter
the orientations of the sunflowers in order to
prevent artefactual visual impressions.
Schilling, M. F. and Watkins, A. E. (1994) A suggestion for sunflower plots. The American Statistician, 48, 303--305.
Murrell, P. (2005) R Graphics. Chapman & Hall/CRC Press.
density
, xyTable
require(stats) # for rnorm
require(grDevices)
## 'number' is computed automatically:
sunflowerplot(iris[, 3:4])
## Imitating Chambers et al, p.109, closely:
sunflowerplot(iris[, 3:4], cex = .2, cex.fact = 1, size = .035, seg.lwd = .8)
## or
sunflowerplot(Petal.Width ~ Petal.Length, data = iris,
cex = .2, cex.fact = 1, size = .035, seg.lwd = .8)
sunflowerplot(x = sort(2*round(rnorm(100))), y = round(rnorm(100), 0),
main = "Sunflower Plot of Rounded N(0,1)")
## Similarly using a "xyTable" argument:
xyT <- xyTable(x = sort(2*round(rnorm(100))), y = round(rnorm(100), 0),
digits = 3)
utils::str(xyT, vec.len = 20)
sunflowerplot(xyT, main = "2nd Sunflower Plot of Rounded N(0,1)")
## A 'marked point process' {explicit 'number' argument}:
sunflowerplot(rnorm(100), rnorm(100), number = rpois(n = 100, lambda = 2),
main = "Sunflower plot (marked point process)",
rotate = TRUE, col = "blue4")
Run the code above in your browser using DataLab