Plotting of a Matrix

Share:

Description

matrixImagePlot: R implementation of myImagePlot.

Usage

1
matrixImagePlot(x,xLabels=NULL, yLabels=NULL, zlim=NULL, title=NULL)

Arguments

x

the matrix.

xLabels

vector of strings to label the columns (default "colnames(x)").

yLabels

vector of strings to label the rows (default "rownames(x)").

zlim

vector containing a low and high value to use for the color scale.

title

title of the plot.

Details

Plotting a table of numbers as an image using R.

The color scale is based on the highest and lowest values in the matrix.

The original R code has been obtained by http://www.phaget4.org/R/myImagePlot.R and then has been modified.

References

http://www.phaget4.org/R/myImagePlot.R

See Also

fabia, fabias, fabiap, fabi, fabiasp, mfsc, nmfdiv, nmfeu, nmfsc, extractPlot, extractBic, plotBicluster, Factorization, projFuncPos, projFunc, estimateMode, makeFabiaData, makeFabiaDataBlocks, makeFabiaDataPos, makeFabiaDataBlocksPos, matrixImagePlot, fabiaDemo, fabiaVersion

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#---------------
# TEST
#---------------

dat <- makeFabiaDataBlocks(n = 100,l= 50,p = 3,f1 = 5,f2 = 5,
  of1 = 5,of2 = 10,sd_noise = 3.0,sd_z_noise = 0.2,mean_z = 2.0,
  sd_z = 1.0,sd_l_noise = 0.2,mean_l = 3.0,sd_l = 1.0)

X <- dat[[1]]
Y <- dat[[2]]

matrixImagePlot(Y)
dev.new()
matrixImagePlot(X)


## Not run: 
#---------------
# DEMO
#---------------

dat <- makeFabiaDataBlocks(n = 1000,l= 100,p = 10,f1 = 5,f2 = 5,
  of1 = 5,of2 = 10,sd_noise = 3.0,sd_z_noise = 0.2,mean_z = 2.0,
  sd_z = 1.0,sd_l_noise = 0.2,mean_l = 3.0,sd_l = 1.0)

X <- dat[[1]]
Y <- dat[[2]]
X <- X- rowMeans(X)
XX <- (1/ncol(X))*tcrossprod(X)
dXX <- 1/sqrt(diag(XX)+0.001*as.vector(rep(1,nrow(X))))
X <- dXX*X

matrixImagePlot(X)


## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.