Subversion Repositories bdplot

Rev

Rev 51 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51 Rev 67
Line 1... Line 1...
1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1),scaleheight=1)
1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1),scaleheight=1,height=bdp()$height)
2
  {
2
  {
3
 
3
 
4
    ## scaleheight is kind of a hack. We need to be able to the height
4
    ## scaleheight is kind of a hack. We need to be able to the height
5
    ## without using mfrow. This is for sharing the x axis between
5
    ## without using mfrow. This is for sharing the x axis between
6
    ## plots.
6
    ## plots.
Line 12... Line 12...
12
###    half <- FALSE
12
###    half <- FALSE
13
###    quadratic <- FALSE
13
###    quadratic <- FALSE
14
 
14
 
15
### first, the height
15
### first, the height
16
    ## should switch be used?
16
    ## should switch be used?
17
    if(any(mfrow<1)){
-
 
18
      stop("Both elements in bdp()$mfrow must be positive. Exiting...")
17
### if height is supplied explicitly by the user, this overrules paper
19
    }
18
### settings
20
 
-
 
21
    if(mfrow[1]*scaleheight<=4){
19
    if(!is.null(height)){
22
      height.touse <- min(mfrow[1]*scaleheight*paperpars$height,paperpars$height.full)
-
 
23
      print(height.touse)
-
 
24
      bdp(height=height.touse)
20
      bdp(height=height)
25
    } else {
21
    } else {
-
 
22
      if(any(mfrow<1)){
-
 
23
        stop("Both elements in bdp()$mfrow must be positive. Exiting...")
-
 
24
      }
-
 
25
      
-
 
26
      if(mfrow[1]*scaleheight<=4){
-
 
27
        height.touse <- min(mfrow[1]*scaleheight*paperpars$height,paperpars$height.full)
-
 
28
        print(height.touse)
-
 
29
        bdp(height=height.touse)
-
 
30
      } else {
26
      bdp(height=paperpars$height.full)
31
        bdp(height=paperpars$height.full)
-
 
32
      }
27
    }
33
    }
28
    
-
 
29
### then the width
34
### then the width
30
      bdp(width=paperpars$width)
35
    bdp(width=paperpars$width)
31
      bdp(size.unit=paperpars$size.unit)
36
    bdp(size.unit=paperpars$size.unit)
32
    
-
 
33
    
-
 
34
  }
37
  }
35
 
38
 
36
## ### first, the height
39
## ### first, the height
37
##     if(mfrow[1]==1){
40
##     if(mfrow[1]==1){
38
##       bdp(height=paperpars$height)
41
##       bdp(height=paperpars$height)