color.bar: Plots a color bar

Description Usage Arguments Details Value

View source: R/functions.R

Description

Plots a color bar

Usage

1
color.bar(C, sz)

Arguments

C

An arbitary maximum for the colour scale

sz

Scaling of bin pixels

Details

color.bar <- function(C,sz) {

#New scale bar plot:

scalebar=1:C

scalebar=2^(seq(log2(1), log2(C), length.out = 50))

scalebar2=tail(scalebar,-1)

scalebar=head(scalebar,-1)

#plot:

plot(5,5,pch=15,cex=sz*1, type="n",las=2, log="y", xlim=c(0,10), ylim=c(1,C), xaxt="n",xlab=NA, ylab="Interaction freq per 10 million pairs",at=c(1,2,5,10,20,50,100,200,500,1000,2000,5000,10000))

rect(rep(1, length(scalebar)),scalebar,

rep(9, length(scalebar)),scalebar2,pch=15,cex=sz*1, col=r*log2(scalebar),border = r*log2(scalebar))

}

Value

A color bar


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