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

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

html - Cut text on left side inside button while centering -

php - Hide Categories from WordPress Dashboard by ID and Custom Post Type -