I tried this out with a correlation matrix for one of my research projects. Here is the resulting image:
Quite nice and colourful. I originally plotted this using something like
> palette = rainbow(256) > image(x, col = palette)But the new functions do not have a facility to directly specify a colour palette. You can feed them an matrix of colours though... So the solution is to transform the raw matrix into a colour matrix. So, assuming that the raw data consists of values between 0 and 1, you could do the following:
> y = matrix((rainbow(256))[c(x) * 255 + 1], ncol = ncol(x), nrow = nrow(x), byrow = TRUE) > grid.raster(y)You need to do a little extra work to get the axes.