X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=Rscripts%2FRgraph.R;fp=Rscripts%2FRgraph.R;h=8cc1c23e3a50d113c55bfa98a9cd4f7f1be39121;hp=14ce864cf1c095748f41fa4636886d5d29a477fa;hb=3647a911117ea08f4f969720a16c58bcc7d4e809;hpb=e217905a27c68a207d44d83114fec6c850531662 diff --git a/Rscripts/Rgraph.R b/Rscripts/Rgraph.R index 14ce864..8cc1c23 100644 --- a/Rscripts/Rgraph.R +++ b/Rscripts/Rgraph.R @@ -660,12 +660,15 @@ plot.dendro.prof <- function(tree, classes, chisqtable, nbbycl = 60, type.dendro #wordcloud(names(lclasses[[i]]), lclasses[[i]], scale = c(1.5, 0.2), random.order=FALSE, colors = colcloud[i]) yval <- 1.1 plot(0,0,pch='', axes = FALSE) - vcex <- norm.vec(lclasses[[i]], 1.5, 1.5) + vcex <- norm.vec(lclasses[[i]], 1, 2) for (j in 1:length(lclasses[[i]])) { yval <- yval-(strheight( names(lclasses[[i]])[j],cex=vcex[j])+0.02) text(-0.9, yval, names(lclasses[[i]])[j], cex = vcex[j], col = colcloud[i], adj=0) } } + if (!from.cmd) { + dev.off() + } } @@ -686,10 +689,14 @@ plot.dendro.cloud <- function(tree, classes, chisqtable, nbbycl = 60, type.dendr lclasses <- list() for (classe in 1:length(sum.cl)) { ntoplot <- toplot[,classe] + names(ntoplot) <- rownames(toplot) ntoplot <- ntoplot[order(ntoplot, decreasing = TRUE)] ntoplot <- round(ntoplot, 0) - ntoplot <- ntoplot[1:nbbycl] + if (length(toplot) > nbbycl) { + ntoplot <- ntoplot[1:nbbycl] + } ntoplot <- ntoplot[order(ntoplot)] + ntoplot <- which(ntoplot > 0) #ntoplot <- ifelse(length(ntoplot) > nbbycl, ntoplot[1:nbbycl], ntoplot) lclasses[[classe]] <- ntoplot } @@ -714,7 +721,7 @@ plot.dendro.cloud <- function(tree, classes, chisqtable, nbbycl = 60, type.dendr plot.phylo(tree,label.offset=0.1,tip.col=col, type=type.dendro) for (i in rev(tree.order)) { par(mar=c(0,0,1,0),cex=0.9) - wordcloud(names(lclasses[[i]]), lclasses[[i]], scale = c(4, 0.8), random.order=FALSE, colors = colcloud[i]) + wordcloud(names(lclasses[[i]]), lclasses[[i]], scale = c(2.5, 0.5), random.order=FALSE, colors = colcloud[i]) } }