[0aeb11]: / shrunkPlot_v1.R

Download this file

19 lines (15 with data), 629 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
shDiffPlot <- function(object, col, ...){
nc <- ncol(object)
nr <- nrow(object)
xlims <- c(0.8, 2*nc + 1.2)
ylims <- c(-0.2, nr + 0.2)
par(mar = c(5.1,7,4.1,2.1))
plot(c(max(xlims), min(xlims)), c(max(ylims), min(ylims)), type="n", axes = FALSE, ...)
axis(1, at = seq(2,2*nc,2), labels = colnames(object))
axis(2, at = 1:nr, labels = rownames(object), las = 2, cex.axis = 0.5)
box()
for (i in 1:nc){
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])
abline(v = 2*i, col = "gray70")
}
}