Last chance! 50% off unlimited learning
Sale ends in
The lines
add a plot for density.circular
objects.
# S3 method for density.circular
lines(x, type = "l", zero.line = TRUE,
points.plot = FALSE, points.col = 1, points.pch = 1, points.cex = 1,
plot.type = c("circle", "line"), bins = NULL, offset=1, shrink = 1,
tcl = 0.025, sep = 0.025, join = TRUE, nosort = FALSE,
plot.info = NULL, zero = NULL, rotation = NULL, ...)
A list with information on the plot: zero, rotation and next.points and, if available, the coordinates x and y.
an object of class density.circular
.
plotting parameter with useful default.
logical; if TRUE
, add a base line at plot.type
is "line"
.
logical; if TRUE
original data are added to
the plot.
parameters used to draw the points.
type of the plot.
number of ticks to plot.
the radius of the circle
parameter that controls the size of the plotted function. Default is 1.
length of the ticks.
constant used to specify the distance between stacked points. Default is 0.025; smaller values will create smaller spaces.
logical: should the first and the last point joined.
logical: should the data sort before plotting. Defaults is to sort.
an object from plot.circular
that
contains information on the zero
, the rotation
and next.points
.
the zero of the plot. Ignored if plot.info
is provided.
the rotation of the plot. Ignored if plot.info
is provided.
further parameters passed to lines.default
.
Claudio Agostinelli
density.circular
and plot.density.circular
set.seed(1234)
x <- rvonmises(n=100, mu=circular(pi), kappa=2)
y <- rvonmises(n=100, mu=circular(pi/2), kappa=2)
resx <- density(x, bw=25)
res <- plot(resx, points.plot=TRUE, xlim=c(-1.5,1), ylim=c(-1.1, 1.5))
resy <- density(y, bw=25)
lines(resy, points.plot=TRUE, col=2, points.col=2, plot.info=res)
Run the code above in your browser using DataLab