search for: colsbreak

Displaying 1 result from an estimated 1 matches for "colsbreak".

Did you mean: colsbreaks
2012 Jul 17
2
aligning image with bar plot in the same plot
...rsBarPlot <- 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) colsBreaks <- sort(unique(c(codeCol-0.5, codeCol+0.5))) image(matrix(codeCol, nrow=1), col=rev(colsImage), breaks=colsBreaks, axes=F) ######### end of code [[alternative HTML version deleted]]