Subversion Repositories bdplot

Rev

Rev 15 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

### a function to plot all columns in a matrix

bdplotmat <- function(x,y=NULL,cols=NULL,...){

  if(is.null(y)){
    y <- x
    dim.y <- dim(y)
    x <- 1:dim.y[1]
  } else {
    dim.y <- dim(y)
  }
##  print(dim.y)
  
  if(is.null(cols))
    cols <- 2:(dim.y[2]+1)
##  print(cols)

  
  bdplot(x,y[,1],ylim=range(y,na.rm=TRUE),col=cols[1],...)

  if(dim.y[2]>1){
    
    for (i in 2:dim.y[2]){
      bdxyadd(x,y[,i],col=cols[i],...)
    }

  }

}