Subversion Repositories bdplot

Rev

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

Rev 24 Rev 27
Line 2... Line 2...
2
### Used to open a graphics driver with BDplot.
2
### Used to open a graphics driver with BDplot.
3
 
3
 
4
### In X11, height  and width are scaled to get a nicer window on the screen.
4
### In X11, height  and width are scaled to get a nicer window on the screen.
5
### This hack is ugly. At least there should be a scaling factor in stead so that all measures are scaled (fonts, etc).
5
### This hack is ugly. At least there should be a scaling factor in stead so that all measures are scaled (fonts, etc).
6
 
6
 
7
bdopen <- function(file=bdp()$file,paper=bdp()$paper,mfrow=bdp()$mfrow)
7
bdopen <- function(file=bdp()$file,paper=bdp()$paper,mfrow=bdp()$mfrow,scale=TRUE)
8
{
8
{
9
  .bdcalcsizes(paper=paper,mfrow=mfrow)
9
  .bdcalcsizes(paper=paper,mfrow=mfrow)
10
  prm <- .bdgetpars()
10
  prm <- .bdgetpars()
11
  if( !is.na(file) )
11
  if( !is.na(file) )
12
    {
12
    {
Line 31... Line 31...
31
          jpeg(filename=file,width=prm$width,height=prm$height,units=prm$size.unit,quality=prm$jpeg.quality,res=prm$jpeg.res,type="cairo")
31
          jpeg(filename=file,width=prm$width,height=prm$height,units=prm$size.unit,quality=prm$jpeg.quality,res=prm$jpeg.res,type="cairo")
32
### bitmap(file=file,type="jpeg",width=prm$width,height=prm$height,units=prm$size.unit,res=prm$jpeg.res,pointsize=.3)
32
### bitmap(file=file,type="jpeg",width=prm$width,height=prm$height,units=prm$size.unit,res=prm$jpeg.res,pointsize=.3)
33
        }
33
        }
34
    }
34
    }
35
  else {
35
  else {
-
 
36
 
-
 
37
    if(scale){
36
    ## to X. Note that this doesn't work on win and osx.
38
      prm$height <- prm$height*2
37
    X11(height=prm$height*2,width=prm$width*2)
39
      prm$width <- prm$width*2
38
    }
40
    }
-
 
41
    ## to X. Note that this doesn't work on win and osx.
-
 
42
    X11(height=prm$height,width=prm$width)
-
 
43
  }
39
 
44
 
40
  par(mfrow=mfrow)
45
  par(mfrow=mfrow)
41
 }
46
}
42
 
47