plot.FEM {fdaPDE} | R Documentation |
Plot a FEM
object
Description
Three-dimensional plot of a FEM
object, generated by FEM
or returned by
smooth.FEM
or FPCA.FEM
.
If the mesh
of the FEMbasis
component is of class mesh.2D
both the 3rd axis and the color represent
the value of the coefficients for the Finite Element basis expansion (coeff
component of the FEM
object).
If the mesh
is of class mesh.3D
, the color of each triangle or tetrahedron represent the mean value of
the coefficients for the Finite Element basis expansion (coeff
).
Usage
## S3 method for class 'FEM'
plot(x, colormap = "heat.colors", num_refinements = NULL, ...)
Arguments
x |
A |
colormap |
A colormap exploited in the plot. The default value is the heat colormap. |
num_refinements |
A natural number specifying how many bisections should be applied to each triangular element for plotting purposes. This functionality is useful where a discretization with 2nd order Finite Element is applied. This parameter can be specified only when a FEM object defined over a 2D mesh is plotted. |
... |
Arguments representing graphical options to be passed to plot3d. |
Value
No return value
See Also
Examples
library(fdaPDE)
## Upload the horseshoe2D data
data(horseshoe2D)
boundary_nodes = horseshoe2D$boundary_nodes
boundary_segments = horseshoe2D$boundary_segments
locations = horseshoe2D$locations
## Create the 2D mesh
mesh = create.mesh.2D(nodes = rbind(boundary_nodes, locations), segments = boundary_segments)
## Create the FEM basis
FEMbasis = create.FEM.basis(mesh)
## Compute the coeff vector evaluating the desired function at the mesh nodes
## In this case we consider the fs.test() function introduced by Wood et al. 2008
coeff = fs.test(mesh$nodes[,1], mesh$nodes[,2])
## Create the FEM object
FEMfunction = FEM(coeff, FEMbasis)
## Plot the FEM function
plot(FEMfunction)