mplot3_img: Draw image (False color 2D)

View source: R/mplot3_img.R

mplot3_imgR Documentation

Draw image (False color 2D)

Description

Draw a bitmap from a matrix of values.

Usage

mplot3_img(
  z,
  as.mat = TRUE,
  col = NULL,
  xnames = NULL,
  xnames.y = 0,
  ynames = NULL,
  main = NULL,
  main.adj = 0,
  x.axis.side = 3,
  y.axis.side = 2,
  x.axis.line = -0.5,
  y.axis.line = -0.5,
  x.axis.las = 0,
  y.axis.las = 1,
  x.tick.labs.adj = NULL,
  y.tick.labs.adj = NULL,
  x.axis.font = 1,
  y.axis.font = 1,
  xlab = NULL,
  ylab = NULL,
  xlab.adj = 0.5,
  ylab.adj = 0.5,
  xlab.line = 1.7,
  ylab.line = 1.7,
  xlab.padj = 0,
  ylab.padj = 0,
  xlab.side = 1,
  ylab.side = 2,
  main.col = NULL,
  axlab.col = NULL,
  axes.col = NULL,
  labs.col = NULL,
  tick.col = NULL,
  cell.lab.hi.col = NULL,
  cell.lab.lo.col = NULL,
  cex = 1.2,
  cex.ax = NULL,
  cex.x = NULL,
  cex.y = NULL,
  zlim = NULL,
  autorange = TRUE,
  pty = "m",
  mar = NULL,
  asp = NULL,
  ann = FALSE,
  axes = FALSE,
  cell.labs = NULL,
  cell.labs.col = NULL,
  cell.labs.autocol = TRUE,
  bg = NULL,
  theme = getOption("rt.theme", "white"),
  autolabel = letters,
  filename = NULL,
  file.width = NULL,
  file.height = NULL,
  par.reset = TRUE,
  ...
)

Arguments

z

Input matrix

as.mat

Logical: If FALSE, rows and columns of z correspond to x and y coordinates accoridngly. This is the image default. If TRUE (default), resulting image's cells will be in the same order as values appear when you print z in the console. This is t(apply(z, 2, rev)). In this case, you can think of z as a table of values you want to pictures with colors. For example, you can convert a correlation table to a figure. In this case, you might want to add cell.labs with the values. Consider first using ddSci.

col

Colors to use. Defaults to colorGrad(100)

cell.labs

Matrix of same dimensions as z (Optional): Will be printed as strings over cells

cell.labs.col

Color for cell.labs. If NULL, the upper and lower quartiles will be set to "white", the rest "black".

bg

Background color

filename

String (Optional): Path to file where image should be saved. R-supported extensions: ".pdf", ".jpeg", ".png", ".tiff".

file.width

Output Width in inches

file.height

Output height in inches

par.reset

Logical: If TRUE, par will be reset to original settings before exit. Default = TRUE

...

Additional arguments to be passed to graphics::image

Details

This is also a good way to plot a large heatmap. This function calls image which is a lot faster than drawing heatmaps

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.