Subversion Repositories bdplot

Rev

Rev 28 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

## a function to add points or lines to a plot. det kan skrives meget
## paenere, om en streng indeholder en karakter.

## grep("l",type)

bdxyadd <- function(x,y=NULL,type=bdp()$type,lwd=bdp()$lwd,pch=bdp()$pch,col=bdp()$col,...){

  prm <- .bdgetpars()
  
  if(any(type=="p",type=="l",type=="s")){
    if(!is.null(y)){
      points(x,y,cex=prm$cex.plot,pch=prm$pch,type=type,col=col,...)
    } else {
      points(x,cex=prm$cex.plot,pch=prm$pch,col=col,type=type,...)
    }
  } else if (type=="lp"|type=="pl"){
    if(!is.null(y)){
      points(x,y,cex=prm$cex.plot,pch=prm$pch,col=col,...)
      lines(x,y,lwd=lwd,col=col,...)
    } else {
      points(x,cex=prm$cex.plot,pch=prm$pch,col=col,...)
      lines(x,lwd=lwd,col=col,...)
    }
  }
}