Subversion Repositories bdplot

Rev

Rev 10 | Rev 29 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 pdel 1
## a function to add points or lines to a plot. det kan skrives meget
2
## paenere, om en streng indeholder en karakter.
3
 
4
## grep("l",type)
5
 
28 pdel 6
bdxyadd <- function(x,y=NULL,type=bdp()$type,lwd=bdp()$lwd,pch=bdp()$pch,col=bdp()$col,cex=bdp()$cex,...){
10 pdel 7
 
8
  prm <- .bdgetpars()
9
 
10
  if(any(type=="p",type=="l",type=="s")){
11
    if(!is.null(y)){
12
      points(x,y,cex=prm$cex.plot,pch=prm$pch,type=type,col=col,...)
13
    } else {
14
      points(x,cex=prm$cex.plot,pch=prm$pch,col=col,type=type,...)
15
    }
16
  } else if (type=="lp"|type=="pl"){
17
    if(!is.null(y)){
18
      points(x,y,cex=prm$cex.plot,pch=prm$pch,col=col,...)
19
      lines(x,y,lwd=lwd,col=col,...)
20
    } else {
21
      points(x,cex=prm$cex.plot,pch=prm$pch,col=col,...)
22
      lines(x,lwd=lwd,col=col,...)
23
    }
24
  }
25
}