[R] custom tick labels on image

Pieter Provoost pieterprovoost at gmail.com
Thu Jul 6 18:29:30 CEST 2006


Hi,

I'm trying to visualise a matrix using image(), and I would like to add 
the row and column names as tick labels. I tried adding an axis, but the 
problem is that this axis goes from 0 to 1 which results in labels being 
added starting at the far right end of the axis.

image(t(data), col = terrain.colors(20), axes=FALSE)
axis(3, at = 1:length(colnames(data)), labels=colnames(data))

How can I do this better?
Cheers
Pieter



More information about the R-help mailing list