> I'm now using image() to show image data (in my case dumps of SOM
> weights) but would like to show RGB colour data, not just single "z"
> colour values.

You can do this fairly readily with ggplot2:

install.packages("ggplot2")
library(ggplot2)
qplot(x, y, data=mydata, fill=rgb, geom="tile") + scale_fill_identity()

(assuming that your variable containing the rgb colour is called rgb)

If your data is originally in the matrix form used by image, see the
examples on http://had.co.nz/ggplot2/geom_tile.html on how to change
to the data.frame form used by ggplot.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to