Subversion Repositories bdplot

Rev

Rev 31 | Rev 33 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 32
Line 7... Line 7...
7
## Could we test if there is an active graphics device? And if not, run bdopen()?
7
## Could we test if there is an active graphics device? And if not, run bdopen()?
8
bdplot <- function(x, y=NULL, z=NULL,
8
bdplot <- function(x, y=NULL, z=NULL,
9
                   ## The rest is irrelevant for the user
9
                   ## The rest is irrelevant for the user
10
                   cex.plot=bdp()$cex.plot,
10
                   cex.plot=bdp()$cex.plot,
11
                   xaxt="n",
11
                   xaxt="n",
-
 
12
                   yaxt="n",
12
                   xlab=bdp()$xlab, ylab=bdp()$ylab,
13
                   xlab=bdp()$xlab, ylab=bdp()$ylab,
13
                   xlim=NULL,
14
                   xlim=NULL,
14
                   ylim=NULL,
15
                   ylim=NULL,
15
                   col=bdp()$col,main=NULL,
16
                   col=bdp()$col,main=NULL,
16
                   ## only used in case of plot mode
17
                   ## only used in case of plot mode
Line 36... Line 37...
36
  if( !is.na(prm$rightlab) ){ mar[4] <- prm$mar.lab[4] }
37
  if( !is.na(prm$rightlab) ){ mar[4] <- prm$mar.lab[4] }
37
  par(mar=mar)
38
  par(mar=mar)
38
 
39
 
39
  par(mgp=prm$mgp.global)
40
  par(mgp=prm$mgp.global)
40
  
41
 
-
 
42
  ## if xaxt or yaxt set, axis are drawn automatically in the plot command. Then it should not be done with axis() later
-
 
43
  prm$draw.xaxis <- ifelse(xaxt="n",prm$draw.xaxis,FALSE)
-
 
44
  prm$draw.yaxis <- ifelse(yaxt="n",prm$draw.yaxis,FALSE)
-
 
45
  
41
  ## Do the plot
46
  ## Do the plot
42
  if(!is.null(y)){
47
  if(!is.null(y)){
-
 
48
    if(prm$debug)
43
    ##       cat("The Bacher/Delff Plotting System (R), (C), TM operating in xy-plotting mode.\n")
49
      cat("The Bacher/Delff Plotting System (R), (C), TM operating in xy-plotting mode.\n")
44
 
50
 
45
    if(is.null(xlim))
51
    if(is.null(xlim))
46
      xlim <- range(x,bdp()$xlim,na.rm=TRUE)
52
      xlim <- range(x,bdp()$xlim,na.rm=TRUE)
47
    if(is.null(ylim))
53
    if(is.null(ylim))
48
      ylim <- range(y,bdp()$ylim,na.rm=TRUE)
54
      ylim <- range(y,bdp()$ylim,na.rm=TRUE)
49
    
55
    
50
    plot(x, y,
56
    plot(x, y,
51
         type=type,
57
         type=type,
52
         xaxt=xaxt, yaxt="n",
58
         xaxt=xaxt, yaxt=yaxt,
53
         cex=cex.plot,
59
         cex=cex.plot,
54
         xlab=xlab,
60
         xlab=xlab,
55
         ylab=ylab,
61
         ylab=ylab,
56
         xlim=xlim,
62
         xlim=xlim,
57
         ylim=ylim,
63
         ylim=ylim,
Line 82... Line 88...
82
      if(is.null(ylim))
88
      if(is.null(ylim))
83
        ylim <- range(x,bdp()$ylim,na.rm=TRUE)
89
        ylim <- range(x,bdp()$ylim,na.rm=TRUE)
84
      
90
      
85
      plot(x,
91
      plot(x,
86
           type=type,
92
           type=type,
87
           xaxt="n", yaxt="n",
93
           xaxt=xaxt, yaxt=yaxt,
88
           cex=cex.plot,
94
           cex=cex.plot,
89
           xlab=xlab,
95
           xlab=xlab,
90
           ylab=ylab,
96
           ylab=ylab,
91
           xlim=xlim,
97
           xlim=xlim,
92
           ylim=ylim,
98
           ylim=ylim,
Line 94... Line 100...
94
           main=main,
100
           main=main,
95
           ...)
101
           ...)
96
    }
102
    }
97
  } else if( class(x) == "acf"){
103
  } else if( class(x) == "acf"){
98
    ## Not cleaned up/checked
104
    ## Not cleaned up/checked
99
    plot(x, xlab="", ylab="", xaxt="n", yaxt="n", cex=prm$cex.plot, xlim=prm$xlim, ylim=prm$ylim,col=col,...)
105
    plot(x, xlab="", ylab="", xaxt=xaxt, yaxt=yaxt, cex=prm$cex.plot, xlim=prm$xlim, ylim=prm$ylim,col=col,...)
100
  }  else if( class(x) == "histogram"){
106
  }  else if( class(x) == "histogram"){
101
    ## Notice: the color of the bars can ONLY be set width bdp(hcol="color").
107
    ## Notice: the color of the bars can ONLY be set width bdp(hcol="color").
102
    plot(x,
108
    plot(x,
103
         xlab=xlab, ylab=ylab,
109
         xlab=xlab, ylab=ylab,
104
         main=prm$main,
110
         main=prm$main,
105
         xaxt="n",yaxt="n",col=bdp()$hcol,
111
         xaxt=xaxt,yaxt=yaxt,col=bdp()$hcol,
106
         border=border,
112
         border=border,
107
         ...)
113
         ...)
108
  } else if( class(x) == "trellis"){
114
  } else if( class(x) == "trellis"){
109
    ## Not cleaned up/checked
115
    ## Not cleaned up/checked
110
    ## very experimental
116
    ## very experimental