Displaying 4 results from an estimated 4 matches for "nodetext".
Did you mean:
nodetest
2005 Oct 23
1
Coloring leaves, twigs and labels in plot.dendrogram()
...Leaf * lab.cex
Y <- xTop
srt <- 0
adj <- c(0, 0.5)
}
else {
Y <- yTop - dLeaf * lab.cex
X <- xTop
srt <- 90
adj <- 1
}
nodeText <- asTxt(attr(subtree, "label"))
if(!is.null(lab.col)){
lab.col <- lab.col[leafcounter - 1]
if(is.null(twig.col) &&
is.null(leaf.col)){
leafcounter <- leafcounter + 1
}
}
text(X, Y, nodeText, xpd = TRUE, srt = srt, adj =
adj,...
2004 Mar 12
1
plot.dendrogram and expressions
...tion of the size of
the character string to be plotted)? Otherwise one could plot the
attributes directly via
diff dendrogram.R /usr/src/R/src/library/stats/R/dendrogram.R
317c317
< text(xBot, yBot + vln, attr(child,"label"))
---
> text(xBot, yBot + vln, nodeText)
337c337
< text(mx, my, attr(child, "edgetext"))
---
> text(mx, my, edgeText)
344c344
< text(xBot, my, attr(child, "edgetext"))
---
> text(xBot, my, edgeText)
and one could use expressions for plotting...
2005 Jul 11
1
indexing into and modifying dendrograms
...2
## dend1[[2]] 3
## dend1[[2]][[1]] <not set>
## dend1[[2]][[1]] 1
## use cNum attribute in "edgetext"
## following example in dendrogram documentation
## would really rather associate with the node than the edge
## but current plotting function has no notion of nodetext
addE <- function(n) {
if(!is.leaf(n)) {
attr(n, "edgePar") <- list(p.col="plum")
attr(n, "edgetext") <- attr(n,"cNum")
}
n
}
dend2 <- dendrapply(dend1, addE)
## overlays the cNum ("cluster number") attribute on dendrog...
2011 Jan 25
1
dendrogram plot does not draw long labels ?
Hello,
It seems that the plot function for dendrograms does not draw labels when
they are too long.
> hc <- hclust(dist(USArrests), "ave")
> dend1 <- as.dendrogram(hc)
> dend2 <- cut(dend1, h=70)
> dd <- dend2$lower[[1]]
> plot(dd) # first label is drawn
> attr(dd[[1]], "label") <- "aaaaaaaaaaaaaaaaaa"
> plot(dd) # first label is