简体   繁体   中英

How to show row and column names in biclust heatmap?

I have drawn heatmap in biclust package using the following code, but I couldn't find any option for adding row and column names.

library(biclust)
set.seed(1234)
data(BicatYeast)
resplaid <- biclust(BicatYeast, BCBimax(), verbose = FALSE)
heatmapBC(x = BicatYeast, bicResult = resplaid)

How can I draw them?

Here a solution. Looking at the heatmapBC function you see that axes as set as FALSE by default! You will be able to put your labels both in the rows and columns of your heatmap by using the axis command. I've used a subsetted version of BicatYeast data for making plots clearer

 library(biclust)
 set.seed(1234)
 data(BicatYeast)
 d <- as.matrix(BicatYeast)[1:30, 1:20]; d
 resplaid <- biclust(d, BCBimax())
 par(mar=c(10, 6, 2, 2) + 0.1)
 heatmapBC(x = d, bicResult = resplaid, axes = F, xlab = "", ylab = "")
 axis(1, at=1:dim(d)[2], labels = colnames(d), las=2)
 axis(2, at=1:dim(d)[1], labels = rownames(d), las=2)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM