Skip to content
Prev 86324 / 398506 Next

Adding dimnames to image()

On Mon, 13 Feb 2006, Markus Preisetanz wrote:

            
I think you are looking for axis labels - they are taken by default from 
your missing x and y arguments. Try something like:

image(matrix(rnorm(200), 10, 20), axes=FALSE)
axis(1, at=seq(0,1,length.out=10), labels=LETTERS[1:10])
axis(2, at=seq(0,1,length.out=20), labels=letters[1:20])
box()

I guess you'll want to set par(mar=) to give a bit more space, and maybe 
rotate the labels too.