如何在热图中反转行图例的颜色?

时间:2016-04-12 16:09:02

标签: r heatmap pheatmap

我想反转行的默认注释:

library(NMF) #any other packages for this task are welcome
car<-cars
car$p<-sample(1:600, 50)*0.0001
aheatmap(as.matrix(cars[,1:2,drop=FALSE]),annRow =car[,"p",drop=FALSE])

enter image description here

正如您在行注释中看到的那样,0表示白色,较大的数字表示较深的绿色。我想看到更小的p,更深的绿色(或灰色)。

此外,如果可能,大于0.05的p将仅呈现白色。

这对我来说真的很有挑战性。感谢您的帮助或评论

1 个答案:

答案 0 :(得分:1)

您可以使用DropboxAPI.DropboxFileInfo info = mDBApi.getFile("/routes.xlsx", null, outputStream, null); 参数更改颜色。这颠倒了绿白的顺序:

annColors

要制作高于p = .05白色的任何内容,您可以对数据进行子集化,使其高于该值aheatmap(as.matrix(cars[,1:2,drop=FALSE]),annRow =car[,"p",drop=FALSE], annColors="-Greens") ,并执行相同的着色:

NA

enter image description here

相关问题