mplot3
: Image (False color 2D)Draw a bitmap from a matrix of values. This is a good way to plot a large heatmap
mplot3.img(z, as.mat = TRUE, col = colorGrad(101, space = "rgb"),
xnames = NULL, xnames.y = 0, ynames = NULL, ynames.x = 0,
main = NULL, main.adj = 0, main.line = 1.5, 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, 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,
x.srt = NULL, y.srt = 0, zlim = NULL, autorange = TRUE,
pty = "m", mar = c(3, 3, 3, 3), asp = NULL, ann = FALSE,
axes = FALSE, cell.labs = NULL, cell.labs.col = NULL,
cell.labs.autocol = TRUE, bg = NULL, theme = "light",
filename = NULL, file.width = NULL, file.height = NULL,
par.reset = TRUE, ...)
Input matrix
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.
Colors to use. Defaults to colorGrad(100)
Matrix of same dimensions as z (Optional): Will be printed as strings over cells
Color for cell.labs
. If NULL, the upper and lower quartiles will be
set to "white", the rest "black".
Background color
String (Optional): Path to file where image should be saved. R-supported extensions: ".pdf", ".jpeg", ".png", ".tiff".
Output Width in inches
Output height in inches
Logical: If TRUE, par will be reset to original settings before exit. Default = TRUE
Additional arguments to be passed to graphics::image
Logical: If TRUE, reverse rows. Defaults to TRUE for a top-left to bottom-right diagonal
This function calls image
which is a lot faster than drawing heatmaps