将上标添加到color2D.matplot rowname标签

时间:2018-02-24 11:41:58

标签: r

我已经能够创建一个color2D.matplot,但是我在将rownames标签放入正确方法时遇到了麻烦。更具体地说,我如何制作" +"符号出现在标题CD4 +,CD8 +和CD4 + RTE中的上标中? 这是我的代码:

labels <- c("TREC",
        "KREC",
        "CD8+",
        "Plasmablast",      
        "CD4+RTE",
        "CD4+",
        "Tcells",
        "Lymphocyte")
labels1 <- paste(c("SNP1","SNP2"))
library(ComplexHeatmap)
library(circlize)
require(grid)
library(gplots)
library(RColorBrewer)
library(plotrix)
mylwid = c(0.5,4)
mylhei = c(0.8,8.5)
par(mar=c(6,1,2,12),cex=1.8,mgp=c(3,0.3,0))
associations <- as.matrix(read.table(file = "heatmap.txt", header=FALSE, sep = "\t"))
cellcolors<-as.matrix(read.table(file ="heatmap_colors.txt", header=FALSE, sep = "\t"))
color2D.matplot(associations,cellcolors=cellcolors,xlab="", ylab="",axes=FALSE)
axis(1,las=2,labels=labels1,at=0.5:1.5,col.ticks='white')
axis(4,las=2,labels=labels, at=0.5:7.5,col.ticks='white')
legend.labels<-c("GW-significant","Suggestive","<0.05","<0.100","Non-significant","<0.100","<0.05","Suggestive","GW-significant")
color.legend(14.5,6,15.5,4,legend.labels,rect.col=c("#0000FF","#0066FF","#00CCFF","#CCFFFF","#FFFFFF","#FFFF00","#FFCC00","#FF6600","#FF0000"),align="rb",gradient="y",cex=1.6)

0 个答案:

没有答案