r - How to draw a straight line in heatmap plot -


i making heatmap data , want add straight line between each set of samples. seems abline doesn't work on heatmap.

any idea function can use purpose?

you have use add.expr argument. example found here might usefull:

x  <- as.matrix(mtcars) rc <- rainbow(nrow(x), start=0, end=.3) cc <- rainbow(ncol(x), start=0, end=.3) hv <- heatmap(x, col = cm.colors(256), scale="column",                rowsidecolors = rc, colsidecolors = cc, margin=c(5,10),                xlab = "specification variables", ylab= "car models",                main = "heatmap(<mtcars data>, ..., scale = \"column\")",                # important bit here                add.expr = abline(h=5, v=2)) 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -