Diff of /shrunkPlot_v1.R [000000] .. [81de4e]

Switch to unified view

a b/shrunkPlot_v1.R
1
shDiffPlot <- function(object, col, ...){
2
    nc <- ncol(object)
3
    nr <- nrow(object)
4
    
5
    xlims <- c(0.8, 2*nc + 1.2)
6
    ylims <- c(-0.2, nr + 0.2)
7
    
8
    par(mar = c(5.1,7,4.1,2.1))
9
    plot(c(max(xlims), min(xlims)), c(max(ylims), min(ylims)), type="n", axes = FALSE, ...)
10
    
11
    axis(1, at = seq(2,2*nc,2), labels = colnames(object))
12
    axis(2, at = 1:nr, labels = rownames(object), las = 2, cex.axis = 0.5)
13
    box()
14
    
15
    for (i in 1:nc){
16
        arrows(x0 = rep(2*i,nr), y0 = c(1:nr), x1 = 2*i + object[,i], y1 = c(1:nr) , length = 0, lwd=4, col = col[i])
17
        abline(v = 2*i, col = "gray70")
18
    }    
19
}