Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-11 Thread Jim Lemon
On 01/11/2014 09:27 AM, Pachapep wrote: ok, I think I got it. Here is the code I used. Thanks for the help guys.. Hi Pachapep, You can also do it like this: library(plotrix) plot(1:10) # show color.scale(1:50,c(0,1,1),c(0,1,0),c(1,1,0),) gradient.rect(1,4,10,6,c(0,1,1),c(0,1,0),c(1,1,0)) Ji

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-10 Thread Pachapep
ok, I think I got it. Here is the code I used. Thanks for the help guys.. fake <- cbind(c(1,2,5,8,12,19), c(2,5,8,12,19,20), c(1,1,1,1,1,1), c(-10,-10,-10,-10,-10,-10), c(10,10,10,10,10,10), runif(6, 0, 2), runif(6, 0, 2)) datalim <- c(-0,10) matrix3plus <- fake[,-(1:2)] dimnames(fake)[[2]]

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-10 Thread Pachapep
Sorry for bugging you again. I was wondering whether it is possible to include multiple different colors instead of just two. In the example below, the color.scale() function goes from yellow to red, but never passes through plain white. Would it be possible to tweak the function or would I hav

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-09 Thread Pachapep
Great, it works perfectly! Thanks so much for the awesome help! (Happy) patrick On Jan 9, 2014, at 7:07, Adams, Jean wrote: > Patrick, > > No error in your code, just two different ways of deriving a range of colors > ... heat.colors() and color.scale(). I modified the code to just use > co

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-09 Thread Adams, Jean
Patrick, No error in your code, just two different ways of deriving a range of colors ... heat.colors() and color.scale(). I modified the code to just use color.scale(). You can tell it what two colors you want it to use for the extremes, and it will work out the shades in between. Jean # fa

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-08 Thread Pachapep
Hi Jean, Thanks for the great help. Indeed, it seems that that helps a bit. However, I included a ‘control’ column made of ones. > fake <- cbind(c(1,2,5,8,12,19), c(2,5,8,12,19,20), c(1,1,1,1,1,1), runif(6, > 0, 2), runif(6, 0, 2), runif(6, 0, 2)) However, the color doesn’t correspond to that

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-08 Thread Pachapep
Hi Jean, Thanks a ton for the help. I think I’m almost there, but there is still something weird about my stuff. I have been able to understand the color.scale() function. Now, I am trying to plot a key for the corresponding colors. The function is called ColorBar, which apparently works - the

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-08 Thread Adams, Jean
Patrick, Thanks for providing reproducible code! I think the main problem was that the extremes= argument in the color.scale() function wants a range (a vector of length 2), and you were providing with more than that, length(lut) is 10. In the process of tracking this down, I made a bunch of min

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-07 Thread Adams, Jean
Patrick, You should cc r-help on all correspondence so that others can follow the thread. The color range will be matched to the "x" argument you provide to the color.scale function (in package plotrix). So you don't need to manually provide the min and max yourself. If for some reason you did

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-07 Thread Adams, Jean
Patrick, You were pretty close. To fix the code you have, just change "matrix" to "mymatrix" in two places, and either specify the argument data= or place the heat.colors bit first in the matrix function. Or ... you could use the array() function instead, to shorten up the code a little. myc

[R] Levelplots with non-continuous x-axis breaks

2014-01-06 Thread Pachapep
Hi all, I have a matrix which I want to plot in color. I have extensively looked at level plot and heatmap/heatmap.2, but I would like to be able to manage the size of the bins (boxes) on my X axis. So I thought of simply using the rect() function, but I can’t get around assigning the correct c