R: Plot method for polynomials

plot.polylist {PolynomF} | R Documentation

## Plot method for polynomials

### Description

Plot methods for polynom or polylist objects

### Usage

    ## S3 method for class 'polylist'
    plot(
      x,
      xlim = 0:1,
      ylim = range(Px),
      type = "l",
      xlab = "x",
      ylab = "P(x)",
      ...,
      col = seq_along(x),
      lty = if (length(col) == 1) seq_along(x) else "solid",
      len = 1000,
      legend = FALSE
    )

    ## S3 method for class 'polynom'
    plot(
      x,
      xlim = 0:1,
      ylim = range(Px),
      type = "l",
      xlab = "x",
      ylab = "p(x)",
      ...,
      len = 1000,
      limits = pu[1:2]
    )

    ## S3 method for class 'polynom'
    lines(x, ..., len = 1000, limits = pu[1:2])

    ## S3 method for class 'polynom'
    points(x, ..., len = 100, limits = pu[1:2])

    ## S3 method for class 'polylist'
    lines(
      x,
      ...,
      len = 1000,
      limits = pu[1:2],
      col = seq_along(x),
      lty = if (length(col) == 1) seq_along(x) else "solid"
    )

    ## S3 method for class 'polylist'
    points(x, ..., len = 100)

### Arguments

`x` | A polynom or polylist object to be plotted
`xlim, ylim` | as for graphics::plot
`type` | as for graphics::plot
`xlab, ylab` | as for graphics::plot
`...` | additional arguments passed on to methods
`col, lty` | Colour(s) and line type(s) as for graphics::plot
`len` | positive integer defining the point or curve resolution
`legend` | logical: for "polylist" objects, should a legend be drawn alongside the main plot?
`limits` | x-limits for the polynomial, default: the entire plot. For polylist objects this may be a two column matrix.

### Value

Nothing of interest, invisibly

### Examples

    p <- poly_from_zeros((-3):4)
    plot(p)
    lines(deriv(p), col = "red")

[Package PolynomF version 2.0-5 Index]