ratio.color.bar: Plots a ratio color bar Example using pileup.r

Description Usage Arguments Details Value

View source: R/functions.R

Description

Plots a ratio color bar Example using pileup.r

Usage

1
ratio.color.bar(lut, min, nticks, title = "")

Arguments

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

Details

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])

}

}

Value

A ratio color bar


gb305/Rpackages documentation built on Feb. 18, 2020, 2:55 p.m.