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=
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.
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
> 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
___
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
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
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.
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
Hi,
Not really sure what you are after, but the following plots a series of
points of varying colour
plot(x,y,type='n')
apply(cbind(x,y,z),1,function(a) {points(a[1],a[2],col=a[3],pch=".")})
but its going to be really slow for a large number of points
Martyn
-Original Message-
From: r-
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
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
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
12 matches
Mail list logo