Subversion Repositories bdplot

Rev

Rev 47 | 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
 
51 pdel 21
    if(mfrow[1]*scaleheight<=4){
22
      height.touse <- min(mfrow[1]*scaleheight*paperpars$height,paperpars$height.full)
23
      print(height.touse)
24
      bdp(height=height.touse)
5 pdel 25
    } else {
15 pdel 26
      bdp(height=paperpars$height.full)
5 pdel 27
    }
28
 
29
### then the width
28 pdel 30
      bdp(width=paperpars$width)
31
      bdp(size.unit=paperpars$size.unit)
32
 
33
 
5 pdel 34
  }
28 pdel 35
 
36
## ### first, the height
37
##     if(mfrow[1]==1){
38
##       bdp(height=paperpars$height)
39
##     } else if(mfrow[1]<4){
40
## #### en graf fylder 1/3, 4 graf fylder det hele
41
##       r <- (3/4)^(1/3)
42
##       bdp(height=mfrow[1]*1/3*paperpars$height.full*r^(mfrow[1]-1))
43
##     } else {
44
##       bdp(height=paperpars$height.full)
45
##     }