Subversion Repositories bdplot

Rev

Rev 10 | Rev 29 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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