plot.imageMatrix {arrayMagic} | R Documentation

## Visualisation of a matrix

### Description

Visualisation of a data matrix, e.g. a matrix representing a two dimensional area, a matrix of distance or similarity scores, or any numeric matrix. Coloured boxes represent values, labels will be drawn inside the box.

### Usage

    plot.imageMatrix(x, labelMatrix, zlim, separateZScale=FALSE, zScale=TRUE, colourRamp, reverseYaxis = TRUE, labels, xLabels, yLabels, width=8, height=7, labelMatrixTextScaling=0.7, plotOutput="standard", fileName, ...)

### Arguments

`x` | data matrix, class `matrix`; required; default missing
`labelMatrix` | matrix of labels of class `array` of dim(`x`); optional; default missing
`zlim` | numeric vector; defines the maximal z-range of the plot; default missing
`zScale` | logical; adds a scale to the plot; required; default TRUE
`separateZScale` | logical; extra plot of the scale; required; default FALSE
`colourRamp` | vector of colours; optional; default missing
`reverseYaxis` | logical; required; default `TRUE`
`labels` | vector of names corresponding to a quadratic `x`; optional; default missing
`xLabels` | vector of names corresponding to the columns of `x` overrides `labels`; optional; default missing
`yLabels` | vector of names corresponding to the rows of `x` overrides `labels`; optional; default missing
`width` | graphics window width; required; default: 8
`height` | graphics window height; required; default: 7
`labelMatrixTextScaling` | numeric; required; default: 0.7
`plotOutput` | character string specifying either "standard", "screen", "twoScreens", "pdf" or "win.metafile"; required; default: "standard"
`fileName` | character string specifying the file path and file name; optional; default missing
`...` | arguments are passed to `image`(), for example `xlab`, `ylab` (x- and y-axis label) and `main` (plot title) and `asp=1` to set the aspect ratio to 1

### Details

If no labels are supplied, the dimnames of `x` or if missing a simple numbering is used instead.

### Author(s)

Andreas Buness <a.buness@dkfz.de>

### Examples

     plot.imageMatrix(x=matrix(c(3,4,4,3),nrow=2, ncol=2),labels=c("one","two"))
     ma <- matrix(c(0.3,0.01,0.7,0.1,0.5,0.3,1,0.5,01), nrow=3,ncol=3)
     class(ma) <- c("imageMatrix", "matrix")
     plot(ma, labelMatrix=ma,labels=c("one","two", "three"), zlim=c(0,1))
     ma <- matrix(c(0.3, 0.01, 0.7, 0.1, 0.5, 0.3, 1, 0.5, 1, 0, 1, 0), nrow = 4, ncol = 3, byrow=TRUE )
     class(ma) <- c("imageMatrix", "matrix")
     plot(ma, labelMatrix = ma, xLabels = c("one", "two", "three"), zlim=c(0,1))
     plot(ma, reverseYaxis=FALSE, labelMatrix = ma, xLabels = c("one", "two", "three"), zlim=c(0,1))

[Package arrayMagic version 1.5.0 Index]