Subversion Repositories bdplot

Rev

Rev 51 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
67 pdel 1
.bdcalcsizes <- function(paper=bdp()$paper,mfrow=c(1,1),scaleheight=1,height=bdp()$height)
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?
67 pdel 17
### if height is supplied explicitly by the user, this overrules paper
18
### settings
19
    if(!is.null(height)){
20
      bdp(height=height)
5 pdel 21
    } else {
67 pdel 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 {
31
        bdp(height=paperpars$height.full)
32
      }
5 pdel 33
    }
34
### then the width
67 pdel 35
    bdp(width=paperpars$width)
36
    bdp(size.unit=paperpars$size.unit)
5 pdel 37
  }
28 pdel 38
 
39
## ### first, the height
40
##     if(mfrow[1]==1){
41
##       bdp(height=paperpars$height)
42
##     } else if(mfrow[1]<4){
43
## #### en graf fylder 1/3, 4 graf fylder det hele
44
##       r <- (3/4)^(1/3)
45
##       bdp(height=mfrow[1]*1/3*paperpars$height.full*r^(mfrow[1]-1))
46
##     } else {
47
##       bdp(height=paperpars$height.full)
48
##     }