使用Heatmaply在热图中未显示行标签 [英] Row labels not showing in heatmap using Heatmaply
问题描述
我正在使用heatmaply创建一个热图,但是不幸的是我的行标签没有显示为名称.行标签是行号.如何在热图上显示第1列的行名?
I am using heatmaply to create a heatmap but unfortunately my row labels are not showing as names. Row labels are row numbers. How can I make my row names from column 1 show on the heatmap ?
这是我的代码:
行名仍然没有显示为标签,而是显示为数字(1,2,3 ...):
the row names are still not showing as labels, but rather as numbers (1,2,3...):
heatmaply(mtcars,k_col = 10,k_row = 1,row.names(mtcars)<-mtcars [,1],cexRow = 0.1,cexCol = 10,margins = c(100,100))
heatmaply(mtcars, k_col =10, k_row =1, row.names(mtcars) <- mtcars[,1], cexRow = 0.1, cexCol=10, margins =c(100,100))
请告知 谢谢
推荐答案
我不知道您的热图应该是什么样(我无法使用您提供的代码生成地图).但是,我只需从您的代码中删除row.names即可生成带有行标签(马自达RX4等)的图形:
I don't know what your heatmap should look like (I could not generate a map with the code you provided). However, I was able to generate a graph with the row labels (Mazda RX4, etc.) by simply removing row.names from your code:
heatmaply(mtcars, k_col =10, k_row =1, cexRow = 0.1, cexCol=10, margins =c(100,100))
这篇关于使用Heatmaply在热图中未显示行标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!