# dev.off()
#}
-PlotDendroCut <- function(chd,filename,reso,clusternb) {
+PlotDendroCut <- function(chd,filename,reso,clusternb) {
h.chd <- as.hclust(chd)
memb <- cutree(h.chd, k = clusternb)
cent <- NULL
vcex <- norm.vec(word.size[,i], 2, 3)
text(-0.9, -0.5, cn[i], cex = 1, adj=0, srt=90, col='black')
for (j in 1:length(word.size[,i])) {
- yval <- yval-(strheight(word.to.plot[j,i],cex=vcex[j])+0.02)
+ yval <- yval-(strheight(word.to.plot[j,i],cex=vcex[j])+0.01)
text(-0.9, yval, word.to.plot[j,i], cex = vcex[j], col = col, adj=0)
}
}
make.simi.afc <- function(x,chitable,lim=0, alpha = 0.1, movie = NULL) {
library(igraph)
+ library(rgl)
chimax<-as.matrix(apply(chitable,1,max))
chimax<-as.matrix(chimax[,1][1:nrow(x)])
chimax<-cbind(chimax,1:nrow(x))
graph.to.file <- function(graph.simi, nodesfile = NULL, edgesfile = NULL, community = FALSE, color = NULL, sweight = NULL) {
require(igraph)
g <- graph.simi$graph
- print(graph.simi$eff)
+ #print(graph.simi$eff)
if (!is.null(graph.simi$eff)) {
V(g)$weight <- graph.simi$eff
} else {
V(g)$weight <- graph.simi$label.cex
}
- layout <- layout.norm(graph.simi$layout,-5,5,-5,5,-5,5)
- print(layout)
+ layout <- layout.norm(graph.simi$layout,-10,10,-10,10,-10,10)
+ #print(layout)
V(g)$x <- layout[,1]
V(g)$y <- layout[,2]
if (ncol(layout) == 3) {
V(g)$z <- layout[,3]
}
+ E(g)$weight <- graph.simi$we.width
if (community) {
member <- graph.simi$communities$membership
col <- rainbow(max(member))
v.colors <- col2rgb(color)
V(g)$r <- v.colors[1,]
V(g)$g <- v.colors[2,]
- V(g)$b <- v.colors[3,]
+ V(g)$b <- v.colors[3,]
}
if (!is.null(sweight)) {
V(g)$sweight <- sweight
graph.to.file2 <- function(graph, layout, nodesfile = NULL, edgesfile = NULL, community = FALSE, color = NULL, sweight = NULL) {
require(igraph)
g <- graph
+ layout <- layout.norm(layout,-5,5,-5,5,-5,5)
V(g)$x <- layout[,1]
V(g)$y <- layout[,2]
if (ncol(layout) == 3) {