Subversion Repositories bdplot

Rev

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

Rev 61 Rev 62
Line 18... Line 18...
18
                   ## only used in case of plot mode
18
                   ## only used in case of plot mode
19
                   type=bdp()$type,
19
                   type=bdp()$type,
20
                   ## Only used in case of histogram plotting
20
                   ## Only used in case of histogram plotting
21
                   border=bdp()$border,freq=NULL,
21
                   border=bdp()$border,freq=NULL,
22
                   ...){
22
                   ...){
23
 
-
 
-
 
23
## set this to TRUE if something is returned. eg, happens in barplot 
24
 
24
  ret <- FALSE
25
  ## experimental. Is this the right consequence of not having a
25
  ## experimental. Is this the right consequence of not having a
26
  ## device opened?
26
  ## device opened?
27
  
27
  
28
  if(length(dev.list())==0){
28
  if(length(dev.list())==0){
29
    cat("No graphics device is initialised. Running bdopen() without arguments.\n")
29
    cat("No graphics device is initialised. Running bdopen() without arguments.\n")
Line 156... Line 156...
156
  } else if (is.numeric(x)){
156
  } else if (is.numeric(x)){
157
    if(prm$method=="barplot"){
157
    if(prm$method=="barplot"){
158
      if(prm$debug)
158
      if(prm$debug)
159
        cat("The Bacher/Delff Plotting System (R), (C), TM operating in barplot mode.\n")
159
        cat("The Bacher/Delff Plotting System (R), (C), TM operating in barplot mode.\n")
160
      ## this does not provide the full x,y functionality of barplot
160
      ## this does not provide the full x,y functionality of barplot
161
      barplot(height=x,
161
      retval <- barplot(height=x,
162
              ## maybe these two are wrong/stupid?
162
                        ## maybe these two are wrong/stupid?
163
              cex.axis=prm$cex.lab,
163
                        cex.axis=prm$cex.lab,
164
              cex.names=prm$cex.lab,
164
                        cex.names=prm$cex.lab,
165
              col=bdp()$hcol,
165
                        col=bdp()$hcol,
166
              border=border,
166
                        border=border,
167
              xlab=xlab,
167
                        xlab=xlab,
168
              ylab=ylab,
168
                        ylab=ylab,
169
              ylim=ylim,
169
                        ylim=ylim,
170
              main=main,
170
                        main=main,
171
              ...)
171
                        ...)
-
 
172
      ret <- TRUE
172
      draw.xaxis <- FALSE
173
      draw.xaxis <- FALSE
173
      draw.yaxis <- FALSE
174
      draw.yaxis <- FALSE
174
      
175
      
175
    } else {
176
    } else {
176
      if(prm$debug)
177
      if(prm$debug)
Line 244... Line 245...
244
  
245
  
245
  if( prm$grid ){
246
  if( prm$grid ){
246
    grid(col=prm$grid.col)
247
    grid(col=prm$grid.col)
247
  }
248
  }
248
  ## vertical lines
249
  ## vertical lines
249
  if( !is.na(prm$grid.v) ){
250
  if( any(!is.na(prm$grid.v)) ){
250
    if(prm$grid.v=="Def"){
251
    if(prm$grid.v[1]=="Def"){
251
      grid(nx=NULL,ny=NA,col=prm$grid.col)
252
      grid(nx=NULL,ny=NA,col=prm$grid.col)
252
    } else
253
    } else
253
    {
254
    {
254
      abline(v=prm$grid.v, lty="dotted", col=prm$grid.col)
255
      abline(v=prm$grid.v, lty="dotted", col=prm$grid.col)
255
    }
256
    }
256
  }
257
  }
257
 
258
 
258
  if( !is.na(prm$grid.h) ){
259
  if( any(!is.na(prm$grid.h)) ){
259
    if(prm$grid.h=="Def"){
260
    if(prm$grid.h[1]=="Def"){
260
      grid(nx=NA,ny=NULL,col=prm$grid.col)
261
      grid(nx=NA,ny=NULL,col=prm$grid.col)
261
    }else{
262
    }else{
262
      abline(h=prm$grid.h, lty="dotted", col=prm$grid.col)}
263
      abline(h=prm$grid.h, lty="dotted", col=prm$grid.col)}
263
    }
264
    }
264
 
265
 
Line 313... Line 314...
313
  options(warn=0)
314
  options(warn=0)
314
 
315
 
315
 
316
 
316
  ##Title stuff
317
  ##Title stuff
317
  ## Hvorfor??
318
  ## Hvorfor??
318
  scale <- 1
319
  scale <- 1.4
319
 
320
 
320
  if( !is.na(prm$tlab) ){
321
  if( !is.na(prm$tlab) ){
321
    mtext(prm$tlab, side=3, line=0.25, cex=prm$cex.lab/scale)
322
    mtext(prm$tlab, side=3, line=0.25, cex=prm$cex.lab/scale)
322
  }
323
  }
323
  if( !is.na(prm$rlab) ){
324
  if( !is.na(prm$rlab) ){
324
    mtext(prm$rlab, side=4, line=0.75, cex=prm$cex.lab/scale,mgp=prm$mgp.raxis)
325
    mtext(prm$rlab, side=4, line=0.75, cex=prm$cex.lab/scale,mgp=prm$mgp.raxis)
325
  }
326
  }
-
 
327
  if(ret){
-
 
328
    invisible(ret)
-
 
329
  }
326
}
330
}
327
 
331
 
328
 
332