showtv <- function(X,Z,itr,ival,i)
{
   if (length(ival)==0)
   { 
       show(X,Z,i)
       return
   }
   n <- dim(X)[2]; a <- 1:n
   points(a[Z==0], X[i,Z==0],col="blue",pch=16)
   points(a[Z==1], X[i,Z==1],col="red",pch=16)
   a <- ival[(1:length(Z[ival]==0))[Z[ival]==0]]
   points(a, X[i,a],col="cyan",pch=16)
   a <- ival[(1:length(Z[ival]==1))[Z[ival]==1]]
   points(a, X[i,a],col="magenta",pch=16)
}

