Re: [R] image plot with color scale

2013-11-19 Thread Jim Lemon
On 11/19/2013 10:07 PM, Witold E Wolski wrote: I am plotting an image of correlations but need to add a color scale... dat<-matrix(rnorm(1000),ncol=5) labels=c("a","b","c","d","e") cortmp<- cor(dat) image(cortmp , axes = F ) axis( 1, at=seq(0,1,length=length(labels)) , labels=labels , cex.axis=

[R] image plot with color scale

2013-11-19 Thread Witold E Wolski
I am plotting an image of correlations but need to add a color scale... dat<-matrix(rnorm(1000),ncol=5) labels=c("a","b","c","d","e") cortmp <- cor(dat) image(cortmp , axes = F ) axis( 1, at=seq(0,1,length=length(labels)) , labels=labels , cex.axis=0.8 ,srt = 45,las=2,cex=1) axis( 2, at=seq(0,1,l

Re: [R] image plot but data not on grid.

2010-08-09 Thread Hadley Wickham
With sweave, you need to explicitly print() the output of ggplot2 and lattice plots. Hadley On Mon, Aug 9, 2010 at 6:32 AM, W Eryk Wolski wrote: > qplot does (?) what I was looking for! > At least it plots what I want to plot in the interactive modus. > However, it seems not to work with Sweave.

Re: [R] image plot but data not on grid.

2010-08-09 Thread W Eryk Wolski
qplot does (?) what I was looking for! At least it plots what I want to plot in the interactive modus. However, it seems not to work with Sweave. Thanks On 7 August 2010 16:15, Michael Bedward wrote: >> If it's regular, but incomplete, that method will work.  If it's >> irregular, then no imag

Re: [R] image plot but data not on grid.

2010-08-07 Thread Michael Bedward
> If it's regular, but incomplete, that method will work.  If it's > irregular, then no image method will work without first interpolating > a regular grid. Thanks Hadley. As I suspected, but ggplot2 is so very clever that I thought it was worth asking :) Michael ___

Re: [R] image plot but data not on grid.

2010-08-07 Thread Hadley Wickham
On Sat, Aug 7, 2010 at 2:54 AM, Michael Bedward wrote: > On 7 August 2010 06:26, Hadley Wickham wrote: > >> library(ggplot2) >> qplot(x, y, fill = z, data = df, geom = "tile") > > Hi Hadley, > > I read the original question as being about irregularly spaced data. > The above method doesn't seem to

Re: [R] image plot but data not on grid.

2010-08-07 Thread Michael Bedward
On 7 August 2010 06:26, Hadley Wickham wrote: > library(ggplot2) > qplot(x, y, fill = z, data = df, geom = "tile") Hi Hadley, I read the original question as being about irregularly spaced data. The above method doesn't seem to for me in such a case but perhaps I'm constructing my example incorr

Re: [R] image plot but data not on grid.

2010-08-06 Thread Hadley Wickham
On Fri, Aug 6, 2010 at 9:24 AM, W Eryk Wolski wrote: > Hi, > > Would like to make an image > however the values in z are not on an uniform grid. > > Have a dataset with > length(x) == length(y) == length(z) > x[1],y[1] gives the position of z[1] > > and would like to encode value of z by a color.

Re: [R] image plot but data not on grid.

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 10:24 AM, W Eryk Wolski wrote: Hi, Would like to make an image however the values in z are not on an uniform grid. Have a dataset with length(x) == length(y) == length(z) x[1],y[1] gives the position of z[1] and would like to encode value of z by a color. looking for some

Re: [R] image plot but data not on grid.

2010-08-06 Thread Martyn Byng
Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of W Eryk Wolski Sent: 06 August 2010 15:25 To: r-help@r-project.org Subject: [R] image plot but data not on grid. Hi, Would like to make an image however the values in z are not on an uniform grid.

[R] image plot but data not on grid.

2010-08-06 Thread W Eryk Wolski
Hi, Would like to make an image however the values in z are not on an uniform grid. Have a dataset with length(x) == length(y) == length(z) x[1],y[1] gives the position of z[1] and would like to encode value of z by a color. looking for something like plot(x,y, col = z) where col for z is cleve

Re: [R] image plot

2009-08-25 Thread Jim Lemon
ogbos okike wrote: Hi, I am trying to use the image function to do a color plot. My matrix columns are labeled y and x. I tried >image(y, x) but I had error message ("Error in image.default(y, x) : increasing 'x' and 'y' values expected"). Could anybody please tell me how to add these increasing

Re: [R] image plot

2009-08-24 Thread Paul Hiemstra
ogbos okike schreef: Hi, I am trying to use the image function to do a color plot. My matrix columns are labeled y and x. I tried >image(y, x) but I had error message ("Error in image.default(y, x) : increasing 'x' and 'y' values expected"). Could anybody please tell me how to add these increasin

[R] image plot

2009-08-24 Thread ogbos okike
Hi, I am trying to use the image function to do a color plot. My matrix columns are labeled y and x. I tried >image(y, x) but I had error message ("Error in image.default(y, x) : increasing 'x' and 'y' values expected"). Could anybody please tell me how to add these increasing 'x' and 'y' values. T

Re: [R] image() plot with z not in matrix format

2007-11-29 Thread Julian Burgos
Hello Marc, Well, image() requires data values in a regular grid. So you need to interpolate your data to a regular grid before you do your plot. There are many interpolation methods, but a good place to start is to do linear interpolation. You should first use expand.grid() to create the r

[R] image() plot with z not in matrix format

2007-11-29 Thread mdgi
Hello R cracks The image() function requires strictly increasing x and y values and z as a matrix. Actually, I don't have equally spaced variables, but anyway want to plot an colored image() (with z-information). An example of my problem is here: a<-data.frame(rnorm(100), rnorm(100), runif(10