Draws a grid of rectangles with colors corresponding to the values in z

ly_image(
  fig,
  z,
  rows,
  byrow = TRUE,
  x = 0,
  y = 0,
  dw = 1,
  dh = 1,
  palette = "Spectral10",
  dilate = FALSE,
  lname = NULL,
  lgroup = NULL
)

Arguments

fig

figure to modify

z

matrix or vector of image values

rows

if z is a vector, how many rows should be used in treating it as a matrix

byrow

if z is a vector, should it be turned into a matrix by row

x

lower left x coordinates

y

lower left y coordinates

dw

image width distances

dh

image height distances

palette

name of color palette to use for color ramp (see here for acceptable values)

dilate

logical - whether to dilate pixel distance computations when drawing

lname

layer name

lgroup

layer group

See also

Examples

# \donttest{ p <- figure(xlim = c(0, 1), ylim = c(0, 1), title = "Volcano") %>% ly_image(volcano) %>% ly_contour(volcano) p # }