Description Usage Arguments Details Value
Plots a ratio color bar Example using pileup.r
1 | ratio.color.bar(lut, min, nticks, title = "")
|
lut |
A color vector for example red, white, blue |
min |
Minimum value for the color bar |
nticks |
Number of ticks for the color bar |
max |
Maximum value for the color bar |
ratio.color.bar <- function(lut,min,nticks, title=”) {
max=-min
ticks=seq(min, 0, len=nticks)}
scale = (length(lut)-1)/(max-min)
tes <- 2^ticks
p = length(tes)
tes[p] = 0
plot(c(5,5), c(min,max), pch=15,cex=sz*1, type='n', bty='n', xlim=c(0,10), xaxt='n', xlab=”, yaxt='n', ylab="Folds of Change Scalebar", main=title)
axis(2, ticks,tes ,las=1) #red scalebar
axis(2, -ticks,tes ,las=1) #blue scalebar
for (i in 1:(length(lut)-1)) {
y = (i-1)/scale + min
rect(1,y,9,y+1/scale, col=lut[i], border=lut[i])
}
}
A ratio color bar
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.