Subversion Repositories bdplot

Rev

Rev 68 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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