Graphical display of polynomial objects

Share:

Description

Standard displsy methods for polynomial or lists of polynomials.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'polynom'
plot(x, xlim = 0:1, ylim = range(Px), type = "l",
   xlab = "x", ylab = "p(x)", ..., len = 1000)
## S3 method for class 'polylist'
plot(x, xlim = 0:1, ylim = range(Px), type = "l",
   xlab = "x", ylab = "P(x)", ..., len = 1000)
## S3 method for class 'polylist'
lines(x, ..., len = 1000)
## S3 method for class 'polynom'
lines(x, ..., len = 1000)
## S3 method for class 'polylist'
points(x, ..., len = 100)
## S3 method for class '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.

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.

Value

Nothing of use.

Author(s)

Bill Venables, with contributions by Kurt Hornik.

References

Nont

See Also

curve

Examples

1
2
3
4
5
6
7
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)