Last data update: 2014.03.03

R: Graphical display of polynomial objects
plot.polynomR Documentation

Graphical display of polynomial objects

Description

Standard displsy methods for polynomial or lists of polynomials.

Usage

## 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

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PolynomF)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PolynomF/plot.polynom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.polynom
> ### Title: Graphical display of polynomial objects
> ### Aliases: plot.polynom plot.polylist lines.polylist lines.polynom
> ###   points.polylist points.polynom
> ### Keywords: symbolmath
> 
> ### ** Examples
> 
> 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)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>