
Last chance! 50% off unlimited learning
Sale ends in
Panel function for plotting functions
panel.plotFun1(..f.., ..., x, y, type = "l",
col = trellis.par.get("superpose.line")$col, npts = NULL, zlab = NULL,
filled = TRUE, levels = NULL, nlevels = 10, surface = FALSE,
alpha = NULL, discontinuity = NULL, discontinuities = NULL)
an object (e.g., a formula) describing a function
additional arguments, typically processed by lattice
panel functions
such as lattice::panel.xyplot()
or lattice::panel.levelplot()
.
Frequently used arguments include
lwd
line width
lty
line type
col
a color
ignored, but there for compatibility with other lattice panel functions
type of plot ("l"
by default)
a vector of colors
an integer giving the number of points (in each dimension) to sample the function
label for z axis (when in surface-plot mode)
fill with color between the contours (TRUE
by default)
levels at which to draw contours
number of contours to draw (if levels
not specified)
a logical indicating whether to draw a surface plot rather than a contour plot
number from 0 (transparent) to 1 (opaque) for the fill colors
a positive number determining how sensitive the plot is to
potential discontinuity. Larger values result in less sensitivity. The default is 1.
Use discontinuity = Inf
to disable discontinuity detection. Discontinuity detection
uses a crude numerical heuristic and may not give the desired results in all cases.
a vector of input values at which a function is
discontinuous or NULL
to use
a heuristic to auto-detect.
plotFun
# NOT RUN {
x <- runif(30,0,2*pi)
d <- data.frame( x = x, y = sin(x) + rnorm(30,sd=.2) )
xyplot( y ~ x, data=d )
ladd(panel.plotFun1( sin, col='red' ) )
xyplot( y ~ x | rbinom(30,1,.5), data=d )
ladd(panel.plotFun1( sin, col='red', lty=2 ) ) # plots sin(x) in each panel
# }
Run the code above in your browser using DataLab