R/voltcol.R

voltcol <-
  function(z,zmin=min(z),zmax=max(z),col=NULL,ncolor=25){
    if(is.null(col[1])){
      #col <- colorRampPalette(c("blueviolet","blue","cyan","green","yellow","orange","red"))(ncolor)
      col <- colorRampPalette(c("darkblue", rainbow(12)[c(9,8,7,5,3,2,1)], "darkred"))(ncolor)
    } else {
      col <- colorRampPalette(col)(ncolor)
    }
    col[.bincode(z,seq(zmin,zmax,length.out=(ncolor+1L)),right=TRUE,include.lowest=TRUE)]
  }

Try the eegkit package in your browser

Any scripts or data that you put into this service are public.

eegkit documentation built on May 1, 2019, 8:02 p.m.