persp_facets: Facets values in a persp plot

View source: R/persp_facets.R

persp_facetsR Documentation

Facets values in a persp plot

Description

Compute the value at the center of facets in a perspective plot of a matrix

Usage

persp_facets(z)

Arguments

z

a numeric matrix to be used as the z argument of link[graphics]{persp}

Value

A matrix of dimensions [nrow(z)-1, ncol(z)-1] with the values at the center of each facet

See Also

interp_scale for an example of usage.

Examples

z <- matrix(1:12, nrow=4)
persp_facets(z)

# use it with persp()
persp(maunga, theta=50, phi=25, scale=FALSE, expand=2,
      border=alpha("black", 0.4),
      col=interp_map(persp_facets(maunga$z), colors=terrain.colors(10)))


jiho/chroma documentation built on Nov. 26, 2022, 2:39 a.m.