Subversion Repositories bdplot

Rev

Rev 68 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
47 pdel 1
 
2
## so far, there's no end function, so should it just be called bdsharex?
65 pdel 3
bdsharex.start <- function(nplots,heights=NULL){
69 pdel 4
  if(is.null(heights)){
5
    heights <- rep(1,nplots)
6
  } else if(length(heights)!=nplots) {
7
    stop("If !is.null(heights), heights must be of length nplots.")
65 pdel 8
  }
69 pdel 9
 
68 pdel 10
  layout(1:(nplots+2), heights=c(lcm(0.1), heights, lcm(1)))
47 pdel 11
  ##  bdp(mar.lab=c(0,5,0.1,1),xaxt="n",las=1,mgp=c(3.5, 1, 0))
68 pdel 12
 
13
  ## Labels seem to be scaled. Need adjustment. This looks ok at least sometimes.
14
  bdp(cex.lab=bdp()$cex.lab*1.3)
15
  bdp(cex.axis=bdp()$cex.axis*1.3)
16
  bdp(cex.legend = bdp()$cex.legend*1.3)
17
 
18
 
47 pdel 19
  bdp(mar.nolab=c(0,bdp()$mar.nolab[2],0,bdp()$mar.nolab[4]))
20
  bdp(mar.lab=c(0,bdp()$mar.lab[2],0,bdp()$mar.lab[4]))
21
 
22
  bdp(xaxt="n",las=1,mgp=c(3.5, 1, 0))
23
  bdplot(0, type="n", yaxt="n", bty="n", xlab="", ylab="")
24
  bdp(mar.nolab=c(0,bdp()$mar.nolab[2],0,bdp()$mar.nolab[4]))
25
}
26
 
48 pdel 27
bdsharex.end <- function(xlab=bdp()$xlab){
49 pdel 28
  mtext(xlab,1,line=1.5,cex=bdp()$cex.lab*par("cex"))
59 pdel 29
##  par(bty="n")
62 pdel 30
  oldbdp <- list()
31
  oldbdp$grid.h <- bdp()$grid.h
32
  oldbdp$grid.v <- bdp()$grid.v
33
  bdp(grid.v=NA)
34
  bdp(grid.h=NA)
35
  bdp(grid=FALSE)
36
  bdplot(1,1,type="n",xaxt="n",yaxt="n",bty="n",ylab="",rlab="")
37
  bdp(grid.h=oldbdp$grid.h,grid.v=oldbdp$grid.v)
48 pdel 38
}