image.FEM: Image Plot of a 2D FEM object

Description Usage Arguments See Also Examples

View source: R/plot.R

Description

Image plot of a FEM object, generated by the function FEM or returned by smooth.FEM and FPCA.FEM. Only FEM objects defined over a 2D mesh can be plotted with this method.

Usage

1
2
## S3 method for class 'FEM'
image(x, num_refinements, ...)

Arguments

x

A 2D-mesh FEM object.

num_refinements

A natural number specifying how many bisections should by applied to each triangular element for plotting purposes. This functionality is useful where a discretization with 2nd order Finite Element is applied.

...

Arguments representing graphical options to be passed to plot3d.

See Also

FEM plot.FEM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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
image(FEMfunction)

fdaPDE documentation built on July 2, 2020, 2:22 a.m.