Hello everybody, I'm trying to create my own color palette on R, in order to interpolate some different temperature data on different maps (daily means, seasonal means,...). I would like to create a color palette which works for each map, so I need a color palette between -40 and +40?C. Sometimes my data for one map range from -10 to +20, sometimes from 10 to 30, etc... but always between -40 and +40?C. I would like a fluent color gradation between my extremas (-40 and +40), with different colors between customed values. For example, if the temperature is under -20?C I would like the color "darkblue", then if the temperature is between -20 and 0?C I would like the color "lightblue", then between 0 and 20?C the color "yellow" and finally over 20?C the color "red". Is it possible to create a fluent gradation color palette with customed colors (not just one color for each part, but something fluent based on the chosen colors) ? Something like this: http://i.stack.imgur.com/5NoJh.jpg I would like then to join this customed color palette to all my "levelplot" or "image.plot" functions,in order to create all my maps. Any help for doing this would be very much appreciated! Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/create-a-color-palette-with-custom-ranges-between-colors-tp4652875.html Sent from the R help mailing list archive at Nabble.com.
create a color palette with custom ranges between colors
4 messages · jeff6868, Pascal Oettli, Nicole K.S. Barker
Hello Package 'RColorBrewer' + function 'colorRampPalette' or ?two.colors HTH Pascal Le 12/12/12 21:00, jeff6868 a ?crit :
Hello everybody, I'm trying to create my own color palette on R, in order to interpolate some different temperature data on different maps (daily means, seasonal means,...). I would like to create a color palette which works for each map, so I need a color palette between -40 and +40?C. Sometimes my data for one map range from -10 to +20, sometimes from 10 to 30, etc... but always between -40 and +40?C. I would like a fluent color gradation between my extremas (-40 and +40), with different colors between customed values. For example, if the temperature is under -20?C I would like the color "darkblue", then if the temperature is between -20 and 0?C I would like the color "lightblue", then between 0 and 20?C the color "yellow" and finally over 20?C the color "red". Is it possible to create a fluent gradation color palette with customed colors (not just one color for each part, but something fluent based on the chosen colors) ? Something like this: http://i.stack.imgur.com/5NoJh.jpg I would like then to join this customed color palette to all my "levelplot" or "image.plot" functions,in order to create all my maps. Any help for doing this would be very much appreciated! Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/create-a-color-palette-with-custom-ranges-between-colors-tp4652875.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121212/c66d165e/attachment.pl>
Thank you Nicole! I did it with the "color.palette" function in the link you gave me. I added then in my levelplot function a sequence with "at": at=seq(-40,40,1) And it works quite good. Thanks again Nicole. Merci ? toi aussi pascal, et vive le CRC ainsi que le grand C..... C..... ! ;) -- View this message in context: http://r.789695.n4.nabble.com/create-a-color-palette-with-custom-ranges-between-colors-tp4652875p4652969.html Sent from the R help mailing list archive at Nabble.com.