Description Usage Arguments Details Value Author(s) Examples
Plot a character
matrix giving the colours to plot.
1 | plotColourMat(x, add = FALSE, ...)
|
x |
A |
add |
|
... |
Arguments passed to |
The colours are plotted as squares as given by x
on the grid
of integers. The entry given in x[i,j]
is plotted as a rectangle
at coordinate (i
, nrow(x)-j
).
Invisibly returns the x and y coordinates and the corresponding colours.
Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | plotColourMat() # Plots a random 6 by 10 colour matrix.
x <- matrix(sample(colors(), 20), ncol = 5)
plotColourMat(x)
x <- matrix(rainbow(100), 1, 100)
plotColourMat(x)
dim(x) <- c(10, 10)
plotColourMat(x)
y <- matrix(sample(colors(), 25), ncol = 5)
plotColourMat(y, add = TRUE)
axis(1)
axis(2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.