Displaying 1 result from an estimated 1 matches for "colorsbarplot".
2012 Jul 17
2
aligning image with bar plot in the same plot
...rix(1:3, nrow=1), widths=c(1,1,1))
# margins
mar1 <- c(1,1,1,1)
par(mar=mar1)
## plot matrix
image(x=(1:(ncol(matI)+1)), y=(1:(nrow(matI)+1)), t(matI), axes=F)
abline(h=c(1,100,200,300), xpd=NA)
## manually adjusting bottom and up par it lines up
## mar1 <- c(1.9,0,1.9,2)
## par(mar=mar1)
colorsBarPlot <- c(rep('green', 100), rep('blue', 100), rep('black', 100))
barplot(rep(1, 300), space=0, border=NA, col=colorsBarPlot, horiz=T, axes=F)
# it works but seems to cumbersome
codeCol <- as.numeric(as.factor(colorsBarPlot))
colsImage <- unique(colorsBarPlot)
colsBreak...