Learn R Programming

circular (version 0.3-1)

curve.circular: Draw Function Plots in a Circle

Description

Draws a curve corresponding to the given function or expression (in x) over the interval [from,to] in a circle. Mainly used to plot circular density functions.

Usage

curve.circular(expr, from = NULL, to = NULL, n = 101, add = FALSE, cex = 1, axes = TRUE, ticks = FALSE, shrink = 1, tcl = 0.025, tcl.text = 0.125, tol = 0.04, uin = NULL, xlim = c(-1, 1), ylim = c(-1, 1), digits = 2, modulo = c("2pi", "asis", "pi"), main = "", xlab = "", ylab = "", ...)
plot.function.circular(x, from = 0, to = 2*pi, ...)

Arguments

expr
an expression written as a function of x, or alternatively the name of a function which will be plotted.
x
a vectorizing numeric Rfunction.
from,to
the range over which the function will be plotted.
n
integer; the number of x values at which to evaluate.
add
logical; if TRUE add to already existing plot.
axes
logical: if TRUE axis are added to the plot.
ticks
logical: if TRUE tick - marks are added to the plot.
shrink
parameter that controls the size of the plotted circle. Default is 1. Larger values shrink the circle, while smaller values enlarge the circle.
tcl
length of the ticks.
tcl.text
The position of the axis labels.
tol
proportion of white space at the margins of plot.
uin
desired values for the units per inch parameter. If of length 1, the desired units per inch on the x axis.
xlim, ylim
the ranges to be encompassed by the x and y axes. Useful for centering the plot.
digits
number of digits used to print axis values.
modulo
the modulo used to process the data.
main, xlab, ylab, cex
graphical parameters.
...
parameters, passed to lines.circular.

Value

  • A list with information on the plot: zero, rotation and next.points.

Details

For now, curve circular draws functions defined in radians, counterclowise coordinate and zero at 0.

See Also

lines.circular

Examples

Run this code
ff <- function(x) sqrt(x)/20
curve.circular(ff)
curve.circular(ff, to=6*pi, join=FALSE, nosort=TRUE, n=1001, modulo="asis", shrink=1.2)

plot.function.circular(function(x) dvonmises(x, circular(0), 10), xlim=c(-1, 2.2))

Run the code above in your browser using DataLab