Subversion Repositories bdplot

Rev

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

Rev Author Line No. Line
47 pdel 1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1),scaleheight=1)
5 pdel 2
  {
47 pdel 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
 
5 pdel 8
    prm <- bdp()
9
    paperpars <- prm[[paper]]
10
### columns, half, quadratic er levn fra et gammelt hack. skal erstattes med skabeloner.
25 pdel 11
###    columns <- 1
12
###    half <- FALSE
13
###    quadratic <- FALSE
5 pdel 14
 
15
### first, the height
28 pdel 16
    ## should switch be used?
17
    if(any(mfrow<1)){
18
      stop("Both elements in bdp()$mfrow must be positive. Exiting...")
19
    }
20
 
47 pdel 21
    if(mfrow[1]*scaleheight<=4){    
22
      bdp(height=mfrow[1]*scaleheight*paperpars$height)    
5 pdel 23
    } else {
15 pdel 24
      bdp(height=paperpars$height.full)
5 pdel 25
    }
26
 
27
### then the width
28 pdel 28
      bdp(width=paperpars$width)
29
      bdp(size.unit=paperpars$size.unit)
30
 
31
 
5 pdel 32
  }
28 pdel 33
 
34
## ### first, the height
35
##     if(mfrow[1]==1){
36
##       bdp(height=paperpars$height)
37
##     } else if(mfrow[1]<4){
38
## #### en graf fylder 1/3, 4 graf fylder det hele
39
##       r <- (3/4)^(1/3)
40
##       bdp(height=mfrow[1]*1/3*paperpars$height.full*r^(mfrow[1]-1))
41
##     } else {
42
##       bdp(height=paperpars$height.full)
43
##     }