Learn R Programming

PolynomF (version 0.94)

plot.polynom: Graphical display of polynomial objects

Description

Standard displsy methods for polynomial or lists of polynomials.

Usage

# S3 method for polynom
plot(x, xlim = 0:1, ylim = range(Px), type = "l",
   xlab = "x", ylab = "p(x)", …, len = 1000)
# S3 method for polylist
plot(x, xlim = 0:1, ylim = range(Px), type = "l",
   xlab = "x", ylab = "P(x)", …, len = 1000)
# S3 method for polylist
lines(x, ..., len = 1000)
# S3 method for polynom
lines(x, ..., len = 1000)
# S3 method for polylist
points(x, ..., len = 100)
# S3 method for polynom
points(x, ..., at = seq(pu[1], pu[2], len = len), len = 100)

Arguments

x

A polynom or polylist object.

xlim, ylim, xlab, ylab, type

As for plot.

Additional arguments sent to plot, points or lines

len

The number of linear line segments to use to present the polynomial curve.

at

the $x-$values where the points are to appear.

Value

Nothing of use.

Details

plot.polynom will by default choose x limits to cover the (real parts of) the zeros, stationary points and points of inflexion of the ploynomial being plotted. plot.polylist chooses by default an x region to accommodate all polynomials on the list in this way. The current palette of colours is used for different components. lines.polynom may be used to add individual polynomials to the plot. The argument len may be used to increase or decrease the number of straight line segments used to represent the curves.

References

Nont

See Also

curve

Examples

Run this code
# NOT RUN {
x <- polynom()
L <- polylist(1, 1-x)
for(j in 2:10) L[[j+1]] <- (2*j - 1 - x)*L[[j]] - (j-1)^2*L[[j-1]]
plot(L[1:5], xlim = c(0,5), xaxs = "r", ylab = expression(L[j](z)),
xlab = "z", main = "Laguerre polynomials to degree 4")

lines(L[[6]], col = "grey", lwd = 2)
# }

Run the code above in your browser using DataLab