On Tue, Feb 15, 2011 at 8:43 PM, Steven Cordwell <s.cordw...@uq.edu.au> wrote: > Hi, > > I have a vectors x and z, for example, > > x <- 0:20 > z <- round(runif(20,1,7)) > y <- 0.5 > > and I want to display z as an image. However if I then call image() with a > vector > > image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",yaxt="n",xaxs="r",yaxs="r")
try image(x,y,as.matrix(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",yaxt="n",xaxs="r",yaxs="r") as.matrix(vector) converts the vector into a 1-column matrix, which seems to be what you need. Peter ______________________________________________ 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.