簡體   English   中英

ColSideColors鍵,用於heatmap.2函數R

[英]ColSideColors key for heatmap.2 function R

我瀏覽了R的gplots包中的heatmap.2()函數的文檔,以尋找為ColSideColors參數編碼顏色鍵的ColSideColors 支持嗎? 我想顯示輸出繪圖上每種顏色代表的級別。

R中的legend功能可以幫助解決該問題。

該代碼如下所示:

heatmap.2(mydata,ColSideColors=mycolors)
# ploting a heatmap
legend("left", title = "Tissues",legend=c("group1","group2"), 
       fill=c("red","green"), cex=0.8, box.lty=0)
# add a legend in which put your group text in legend, 
# and pass your colors which is used in heatmap.2 to fill.

您可以在本教程中獲得幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM