Subversion Repositories bdplot

Rev

Rev 24 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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