plotMatrix | R Documentation |
'plotMatrix' plots a matrix, decorated with the names
of rows and columns, and, if requested, with lines separating
specified rows/columns. Also, a legend
gets drawn, by default.
plotMatrix(x, col = gray.colors(16),
transpose = FALSE,
axes = c(2, 3), legend = TRUE,
legend.width = 0.2,
legend.nlevels = length(col) +
1, main = NULL,
rowDelim = NULL,
rowDelimCol = "black",
colDelim = NULL,
colDelimCol = "black",
useRaster = NULL)
x |
a matrix |
col |
colors |
transpose |
|
axes |
which |
legend |
draw |
legend.width |
the relative width of the |
legend.nlevels |
number of levels in the |
main |
|
rowDelim |
an optional vector of rows after which to put a separation line |
rowDelimCol |
the color of the row separation line |
colDelim |
an optional vector of columns after which to put a separation line |
colDelimCol |
the color of the column separation line |
useRaster |
if |
Tomas Sieger
x<-matrix(1:36,6)
rownames(x)<-paste('row',1:6)
colnames(x)<-paste('column',1:6)
x
plotMatrix(x)
# group rows and columns
x<-repmat(matrix(3-c(1,2,1,2,3,2,1,2,1),3),3,3)
plotMatrix(x, rowDelim = c(3,6), colDelim = c(3,6), colDelimCol='red')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.