search for: colorramp

Displaying 20 results from an estimated 44 matches for "colorramp".

2009 Apr 17
1
ColorRamp different from ColorRampPalette
I try to use ColorRamp as ColorRampPalette (i.e. with the same gradient), but it seems there is a nuance that I've missed. pal.crp<-colorRampPalette( c("blue", "white", "red"), space = "rgb") plot(rep(0,40),pch=16,col=pal.crp(40)) # is great But, using the same gradient wi...
2013 Jul 24
1
Alpha channel in colorRamp() and colorRampPalette()
Hi all, I had the need to create a colorbar considering the alpha channel of the colors, but colorRamp() and colorRampPalette() ignored the alpha argument in rgb(). So I performed some minor modifs. in their codes, as to support the interpolation using the alpha channel. I guess that those simple modifications might be useful for other people, so perhaps it would be worth to add them to colorRamp...
2010 Sep 21
1
Colorramp in Maptools, how to choose min and max values for the fg= argument
Hello, I am using maptools for plooting geographical data. The colour of the region indicates some region dependent value (population for example). I pass the colours of the regions to the plot.Map function by defining the foreground colour: jet.colors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")) n=100 cols <- jet.colors(n) Intervalls = cut(as.numeric(Vector),n, na.rm=TRUE) fgs <-cols[Intervalls]...
2010 Mar 26
0
ColorRamp different from ColorRampPalette
Try the rgb function in the grDevices library. pal.cr<-colorRamp( c("blue", "white", "red"), space = "rgb") plot(rep(0,40),pch=16,col=rgb(pal.cr((0:40)/40),max=255)) Troy -- View this message in context: http://n4.nabble.com/ColorRamp-different-from-ColorRampPalette-tp889372p1692642.html Sent from the R help mailing l...
2008 Oct 27
1
Problem with script
...ull(xLabels) ){ xLabels <- c(1:ncol(x)) } if( is.null(yLabels) ){ yLabels <- c(1:nrow(x)) } layout(matrix(data=c(1,2), nrow=1, ncol=2), widths=c(4,1), heights=c(1,1)) # Red and green range from 0 to 1 while Blue ranges from 1 to 0 ColorRamp <- rgb( seq(0,1,length=256), # Red seq(0,1,length=256), # Green seq(1,0,length=256)) # Blue ColorLevels <- seq(min, max, length=length(ColorRamp)) # Reverse Y axis reverse <- nrow(x) : 1 yLabels <-...
2018 Oct 03
1
grDevices::convertColor and colorRamp(space='Lab') Performance Improvements
`grDevices::convertColor` performance can be improved by 30-300x with small changes to the code. `colorRamp(space='Lab')` uses `convertColor` so it too benefits from substantial performance gains. `convertColor` vectorizes explicitly over the rows of the input color matrix using `apply`. The level-1 patch [1] illustrates a possible minimal set of changes to achieve this with just R matrix and...
2016 Apr 16
0
Mean of hexadecimal numbers
...want to treat each of them as a single integer. A simple-minded approach would split them into 3 hex numbers, and average those (using Bert's solution). A more sophisticated approach would take into account that they are really colours. You could probably put together something using the colorRamp or colorRampPalette functions to average in perception space. For example, # Average the 1st two by taking the middle colour of a 3 colour palette x <- colorRampPalette(c("#FF7C00","#00BF40"), space = "Lab")(3)[2] # Average in the third by taking the 2nd of a 4...
2005 Oct 03
5
heatmap
Hi, i created a graph with heatmap(sma) function: heatmap(dataHeat(x)) and I wish to change the gradation of colors from blue to red, how could i do? Using "heatmap(dataHeat(x), col=c(2,4))" i will use only 2 colors without gradation. Ty so much Andrea
2016 Apr 16
5
Mean of hexadecimal numbers
Hi, How would you calculate the "mean colour" of several colours, for example c("#FF7C00","#00BF40","#FFFF00")? Yours, Atte Tenkanen
2009 Mar 27
3
color vectors other than gray()
I'm trying to create a graph where different cells of a grid (a shapefile) will be painted with a color share scale, where the most easy way is to use gray(). Can I somehow get a vector (gradient) of colors, a vector of colors with other methods but gray()? I'm doing this until now quad_N_sp <-
2016 Apr 16
1
Mean of hexadecimal numbers
...olors in R: myColors <- c("#FF7C00","#00BF40","#FFFF00") Colors=rgb2hsv(col2rgb(myColors)) apply(Colors,1,mean) h s v 0.2122974 1.0000000 0.9163399 * * * * * # Average the 1st two by taking the middle colour of a 3 colour palette x <- colorRampPalette(c("#FF7C00","#00BF40"), space = "Lab")(3)[2] # Average in the third by taking the 2nd of a 4 colour palette, so x # gets twice the weight colorRampPalette(c(x, "#FFFF00"), space = "Lab")(4)[2] rgb2hsv(col2rgb(colorRampPalette(c(x, "#FF...
2011 Apr 22
1
Dual colour ramps based on pos/neg values
...other words, I have a time series whose data can range arbitrarily from -0.34 to +1.9, for example. However, for the visualization to be effective, I need to be able to distinguish conclusively where the division between positive and negative takes place. My original thought was to just modify the colorRampPalette function inputs to achieve the effect. Unfortunately, because of the smooth blending, it washes out the middle. Not to mention the middle of the colour range is not always zero. What I would to do is concatenate two colour ranges such that: bright red (max negative) -> dark red (min neg...
2010 Nov 20
1
Setting a Red->Yellow->Green Color Transition in Image(...) with yellow corresponding with the Mean Value...
In the following example I would like to have the color transition from Red->yellow->green in the image(...) function, and if possible have the yellow be set to correspond with the mean value (for the below 75). ? I was able to figure something like out when using filled.contour(...), e.g. filled.contour(ak.fan, levels = c(70, 73, 76,?80, 90), color = terrain.colors) (I still
2004 Nov 02
2
Color schemes that work for people with color-deficient vision
A recent article in the earth science literature cited below and available at http://geography.uoregon.edu/datagraphics/EOS/ points out that rainbow color schemes and mixtures of green and yellow can be troublesome for people with color-deficient vision. The authors propose alternative schemes that can be viewed and downloaded in RGB, HSV, CMYK, and RGB256 formats from
2009 May 20
4
Functions returning functions
Dear All: I have a question regarding the behavior of functions. Say I define a function that returns another function : A <- function(parameters) { # calculations w/ parameters returning 'y' tmpf <- function(x) { # function of 'y' } return(tmpf) } The value of the parameters are stored in an environment local to the function. Then I call x<- something
2008 May 28
1
heatmap-changing column or row names
...15 14 13 12 11 12 10 9 8 7 6 8 9 pink 11 11 11 11 11 10 12 11 13 14 14 15 15 14 14 17 17 17 blue 17 15 15 16 17 17 17 17 18 18 18 19 20 20 20 21 22 21 the column names are timepoints 450 in total. When I run the heatmap code: x <- as.matrix(o4) ramp <- colorRamp(c("yellow","green","blue")) cv<-rgb( ramp(seq(0, 1, length = 83)), max = 255) heatmap(x, col = cv, Colv=NA, Rowv=NA,xaxt="n", yaxt="n", scale="column", margins=c(5,10), labCol=NA,xlab = "Time", ylab= "Colors", main...
2006 Sep 28
0
Documentation patch for 'match' and 'palette'
Here is a patch to improve documentation for finding useful, yet newish, functions: 'findInterval' and 'colorRamp'. I think that it is worthwhile to mention these in the 'seealso' section of the similar 'match' and 'palette' documents. I had difficulty finding these functions at first, as they have compound names. Modify the patch as needed. +mt -------------- next part --------...
2008 Nov 20
1
more color choice with heatmap.2
Dear All: I have a question on how to get more choices of color to show gene expression up or down regulation, like choosing the neutral color as yellow, any way to work with the color transition? I could not find any reference on those. Thanks for your help Hao [[alternative HTML version deleted]]
2012 Sep 28
1
Heatmap Colors
Hello R-Users! I'm using a heatmap to visualize a matrix of values between -1 and 3. How can I set the colors so that white is zero, below zero is blue of increasing intensity towards -1 and above zero is red of increasing intensity towards red? I tried like this (using the marray and gplots packages from bioconductor): mcol <- maPalette(low="blue", mid="white",
2016 Apr 04
0
Question about function DrawDensity3D {VecStatGraphs3D}
...s = 3, DrawAxes = FALSE) { open3d(windowRect = c(100, 100, 800, 800)) bg3d("white") Cx = vectors[, 1] Cy = vectors[, 2] Cz = vectors[, 3] Cr <- kde3d(x = Cx, y = Cy, z = Cz, n = Div) th <- seq(min(Cr$d), max(Cr$d), len = Layers + 2) ramp <- colorRamp(c("white", "yellow", "red")) colo <- rgb(ramp(seq(0, 1, length = Layers)), maxColorValue = 255) al <- seq(0.1, 0.6, len = Layers) module = sqrt(Cx * Cx + Cy * Cy + Cz * Cz) spheres3d(0, 0, 0, radius = max(module), color = "black",...