Re: [R] image() with a vector

2011-02-16 Thread Steven Cordwell
On Wed, 16 Feb 2011 05:16:07 pm Dieter Menne wrote: > Steven Cordwell wrote: > > However, transforming z into a matrix with two rows, where both rows are > > the same as z above does seem to be a workaround. > > > > z <- matrix(c(z,z),2,length(z),byrow=TRUE) > > y <- c(0.25,0.75) > > image(x,y,t(z

Re: [R] image() with a vector

2011-02-15 Thread baptiste auguie
Hi, rasterImage may alleviate the pdf artefacts in the viewer. This seems to produce a similar output, plot(range(x),range(y), t="n") rasterImage(t(rgb(colorRamp(heat.colors(7))(z/max(z))/255)), min(x),min(y),max(x),max(y), interpolate=FALSE) HTH, baptiste On 16 February 2011 05:43, Steven Cor

Re: [R] image() with a vector

2011-02-15 Thread Dieter Menne
Steven Cordwell wrote: > > However, transforming z into a matrix with two rows, where both rows are > the same as z above does seem to be a workaround. > > z <- matrix(c(z,z),2,length(z),byrow=TRUE) > y <- c(0.25,0.75) > image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",ya

Re: [R] image() with a vector

2011-02-15 Thread Peter Langfelder
On Tue, Feb 15, 2011 at 8:43 PM, Steven Cordwell 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),x

[R] image() with a vector

2011-02-15 Thread Steven Cordwell
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") then I get the error E