GP.plot.curve {BayesGPfit} | R Documentation |
Graphical representation of one, two, three-dimensional curves
Description
Graphical representation of one, two, three-dimensional curves
Usage
GP.plot.curve(
curve,
xlab = NULL,
ylab = NULL,
zlab = NULL,
xlim = NULL,
ylim = NULL,
zlim = NULL,
col.regions = NULL,
cut = NULL,
num_slices = NULL,
...
)
Arguments
curve |
A list object with two elements:
|
xlab |
A character specifying the label of x-axis for 1D, 2D and 3D case. The default value is NULL and set to "x" for 1D case and "x1" for 2D and 3D cases. |
ylab |
A character specifying the label of y-axis for 1D curve or coords for 2D and 3D case. The default value is NULL and set to "x2" for 2D and 3D cases. |
zlab |
A character specifying the label of z-axis only for 3D case. The default value is NULL and set to "x3". |
xlim |
A vector of two real numbers specifying the range of x-axis for 1D, 2D and 3D case. The default value is NULL and set to range(curve$x[,1]). |
ylim |
A vector of two real numbers specifying the range of y-axis only for 2D, 3D case. The default value is NULL and set to range(curve$x[,2]). |
zlim |
A vector of two real numbers specifying the range of z-axis only for 3D case. The default value is NULL and set to range(curve$x[,3]). |
col.regions |
A vector of RGB colors for 2D and 3D plots. See GP.create.cols. The default value is NULL and set to GP.create.cols(). |
cut |
An integer specifying the number of colors in 2D and 3D plots. The default value is NULL and set to length(col.regions)-1. |
num_slices |
An integer specifying the number of slices cutting through the 3rd dimension to show. |
... |
All other parameters for plot (1D case) and levelplot (2D and 3D cases). |
Value
NULL for 1D case. An object of class "trellis" for 2D and 3D cases.
Author(s)
Jian Kang <jiankang@umich.edu>
Examples
library(BayesGPfit)
library(lattice)
set.seed(1224)
##plot 1D curve
x1d = GP.generate.grids(d=1,num_grids = 1000)
curve1d = GP.simulate.curve.fast(x1d,a=0.01,b=0.5,
poly_degree=10L)
GP.plot.curve(curve1d,main="Simulated 1D Curve")
##plot 2D curve
x2d = GP.generate.grids(d=2L,num_grids = 100)
curve2d = GP.simulate.curve.fast(x2d,a=0.01,b=0.5,
poly_degree=10L)
GP.plot.curve(curve2d,main="Simulated 2D Curve")
##plot 3D curve
x3d = GP.generate.grids(d=3,num_grids = 50)
curve3d = GP.simulate.curve.fast(x3d,a=0.01,b=0.5,
poly_degree=10L)
GP.plot.curve(curve3d,main="Simulated 3D Curve",num_slices=10,zlim=c(-0.5,0.5))