dev.new(width=3.5,height=3) inter_plot(1:ncol(m),m,cols,lx=3.3,ly=9) dev.new(width=3.5,height=3) inter_plot(1:nrow(m),t(m),cols,lx=2.6,ly=9) d <- as.matrix(dist(1:3)) rownames(d) <- colnames(d) <- rownames(m) g <- mk_complete_graph(d) ig <- igraph.from.graphNEL(g) dev.new(width=2,height=2) par(mar=c(0,0,0,0)) plot(ig,vertex.label=get.vertex.attribute(ig, "name"),edge.width=2,vertex.size=45,edge.label.cex=.3,vertex.label.cex=1,layout=cbind(c(1,3,2),c(2,2,1))) d <- as.matrix(dist(1:4)) rownames(d) <- colnames(d) <- colnames(m) g <- mk_complete_graph(d) ig <- igraph.from.graphNEL(g) dev.new(width=2,height=2) par(mar=c(0,0,0,0)) plot(ig,vertex.label=get.vertex.attribute(ig, "name"),edge.width=2,vertex.size=45,edge.label.cex=.3,vertex.label.cex=1,layout=cbind(c(1,3,2),c(2,2,1))) plot(ig,vertex.label=get.vertex.attribute(ig, "name"),edge.width=2,vertex.size=45,edge.label.cex=.3,vertex.label.cex=1,layout=cbind(c(1,1,2,2),c(2,1,2,1))) nn <- c("A1","B1","C1","D1","A2","B2","C2","D2","A3","B3","C3","D3") g <- new("graphNEL", nodes=nn) for (a in nodes(g)) { a1 <- strsplit(a,"")[[1]] for (b in nodes(g)){ b1 <- strsplit(b,"")[[1]] if (a !=b && length(intersect(a1,b1) !=0)) { g <- addEdge(a,b,g) }}} ig <- igraph.from.graphNEL(g) dev.new(width=4,height=4) par(mar=c(0,0,0,0)) pos1 <- cbind(c(1,1,2,2),c(1,2,1,2)) pos <- rbind(pos1,pos1+.2, pos1+.4) cols <- rep(rainbow(3,alpha=.6),each=4) plot(ig,vertex.label=get.vertex.attribute(ig, "name"),edge.width=2,vertex.size=30,edge.label.cex=.3,vertex.label.cex=1,layout=pos,vertex.color=cols) o <- c(1,2,3,1) # o <- hpaths(1:ncol(m)); o <- c(o[1,],NA,o[2,]) x <- 1:ncol(m) dev.new(width=3.5,height=3) inter_plot(x,t(m[o,]),cols,main="Eulerian on K3",lx=3.2,ly=9)