Learn R Programming

BSPBSS (version 1.0.6)

levelplot2D: levelplot for 2D images.

Description

The function plots 2D images for a data matrix.

Usage

levelplot2D(
  S,
  coords,
  lim = c(min(S), max(S)),
  xlim = c(0, max(coords[, 1])),
  ylim = c(0, max(coords[, 2])),
  color = bluered(100),
  layout = c(1, nrow(S)),
  file = NULL
)

Value

No return value.

Arguments

S

Data matrix with q rows (sample) and p colums (pixel).

coords

Coordinates matrix with p rows (pixel) and 2 columns (dimension), specifying the coordinates of the data points.

lim

2-dimensional numeric vector, specifying the limits for the data.

xlim

2-dimensional numeric vector, specifying the lower and upper limits of x.

ylim

2-dimensional numeric vector, specifying the lower and upper limits of y.

color

Colorbar.

layout

2-dimensional numeric vector, specifying the number of rows and number of columns for the layout of components.

file

Name of the file to be saved.

Examples

Run this code
sim = sim_2Dimage(length = 30, sigma = 5e-4, n = 30, smooth = 6)
levelplot2D(sim$S,lim = c(-0.04,0.04), sim$coords)

Run the code above in your browser using DataLab