Subversion Repositories bdplot

Rev

Rev 28 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 47
Line 1... Line 1...
1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1))
1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1),scaleheight=1)
2
  {
2
  {
-
 
3
 
-
 
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
-
 
6
    ## plots.
-
 
7
    
3
    prm <- bdp()
8
    prm <- bdp()
4
    paperpars <- prm[[paper]]
9
    paperpars <- prm[[paper]]
5
### columns, half, quadratic er levn fra et gammelt hack. skal erstattes med skabeloner.
10
### columns, half, quadratic er levn fra et gammelt hack. skal erstattes med skabeloner.
6
###    columns <- 1
11
###    columns <- 1
7
###    half <- FALSE
12
###    half <- FALSE
Line 11... Line 16...
11
    ## should switch be used?
16
    ## should switch be used?
12
    if(any(mfrow<1)){
17
    if(any(mfrow<1)){
13
      stop("Both elements in bdp()$mfrow must be positive. Exiting...")
18
      stop("Both elements in bdp()$mfrow must be positive. Exiting...")
14
    }
19
    }
15
 
20
 
16
    if(mfrow[1]<=4){    
21
    if(mfrow[1]*scaleheight<=4){    
17
      bdp(height=mfrow[1]*paperpars$height)    
22
      bdp(height=mfrow[1]*scaleheight*paperpars$height)    
18
    } else {
23
    } else {
19
      bdp(height=paperpars$height.full)
24
      bdp(height=paperpars$height.full)
20
    }
25
    }
21
    
26
    
22
### then the width
27
### then the width