Subversion Repositories bdplot

Rev

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

Rev Author Line No. Line
15 pdel 1
### a function to plot all columns in a matrix
2
 
26 pdel 3
bdplotmat <- function(x,y=NULL,cols=NULL,ltys=NULL,...){
15 pdel 4
 
5
  if(is.null(y)){
6
    y <- x
7
    dim.y <- dim(y)
8
    x <- 1:dim.y[1]
9
  } else {
10
    dim.y <- dim(y)
11
  }
12
##  print(dim.y)
13
 
14
  if(is.null(cols))
15
    cols <- 2:(dim.y[2]+1)
26 pdel 16
 
17
    if(is.null(ltys))
18
    ltys <- rep(1,dim.y[2])
15 pdel 19
##  print(cols)
20
 
21
 
26 pdel 22
  bdplot(x,y[,1],ylim=range(y,na.rm=TRUE),col=cols[1],lty=ltys[1],...)
15 pdel 23
 
24
  if(dim.y[2]>1){
25
 
26
    for (i in 2:dim.y[2]){
26 pdel 27
      bdxyadd(x,y[,i],col=cols[i],lty=ltys[i],...)
15 pdel 28
    }
29
 
30
  }
31
 
32
}
33
 
34