注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

wangyufeng的博客

祝愿BB 健康开心快乐每一天

 
 
 

日志

 
 

R: Color Schemes for Images and Heat Maps  

2011-12-27 09:33:03|  分类: R、SVG&GNUPlot画 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Create a vector of N contiguous colors.

Usage

redscale(N) greenscale(N) bluescale(N) blueyellow(N) redgreen(N) jetColors(N) 

Arguments

N an integer; the number of distinct levels in the color map

Details

The color maps that ship with R (see, for example, terrain.colors) do not include the most common colors maps used in publications in the microarray literature. This collection of color maps expands the available options. The functions redscale, greenscale, and bluescale each range from pure black for low values to a pure primary color for high values.

The redgreen color map ranges from pure green at the low end, through black in the middle, to pure red at the high end. Although this is the most common color map used in the microarray literature, it will prove problematic for individuals with red-green color-blindness.

The blueyellow color map ranges from pure blue at the low end, through gray in the middle, to pure yellow at the high end.

The jetColors map tries to reproduce the default "jet" color map from MATLAB.

Value

A character vector 'cv' of color names. This can be used to create a user-defined color palette for subsequent graphics by 'palette(cv)' or directly in a 'col=' specification in 'par' or in graphics functions such as 'image' or 'heatmap'.

BUGS

The names redgreen and blueyellow are inconsistent with respect to which color represents low values and which color represents high values. It is too late to fix this.

Author(s)

Kevin R. Coombes <kcoombes@mdanderson.org>

See Also

rainbow, topo.colors, terrain.colors, heat.colors, rgb, image, heatmap, palette.

Examples

data <- matrix(1:1024, nrow=1024) image(data, col=bluescale(64)) image(data, col=redgreen(32)) image(data, col=redscale(128)) image(data, col=blueyellow(64)) image(data, col=jetColors(64)) rm(data) # cleanup
via:http://bioinformatics.mdanderson.org/Software/OOMPA/ClassDiscovery/html/colorSchemes.html
  评论这张
 
阅读(1373)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017