gcurve: Draw function curves

View source: R/gplots.R

gcurveR Documentation

Draw function curves

Description

Draws a curve corresponding to a function over the interval [from, to]. gcurve can plot also an expression in the variable xname, default x.

Usage

gcurve(
  expr,
  from = NULL,
  to = NULL,
  n = 101,
  add = FALSE,
  type = "l",
  xname = "x",
  xlab = xname,
  ylab = NULL,
  log = NULL,
  xlim = NULL,
  ...,
  grid = TRUE,
  col.grid = "grey90",
  col.acc = "white"
)

## S3 method for class ''function''
gplot(
  x,
  y = 0,
  to = 1,
  from = y,
  xlim = NULL,
  ylab = NULL,
  grid = TRUE,
  col.grid = "grey90",
  col.acc = "white",
  ...
)

Arguments

expr

The name of a function, or a call or an expression written as a function of x which will evaluate to an object of the same length as x.

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 an already existing plot; if NA start a new plot taking the defaults for the limits and log-scaling of the x-axis from the previous plot. Taken as FALSE (with a warning if a different value is supplied) if no graphics device is open.

type

plot type: see plot.default.

xname

character string giving the name to be used for the x axis.

xlim

NULL or a numeric vector of length 2; if non-NULL it provides the defaults for c(from, to) and, unless add = TRUE, selects the x-limits of the plot – see plot.window.

grid

logical; if TRUE, a background grid will be drawn

col.grid

grid color

col.acc

grid accent color

x

a ‘vectorizing’ numeric R function.

y

alias for from for compatibility with plot


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.