Thanks a lot. I didn't find that. I prefered the option with class discovery package which we have to install from OOMPA project. barbara
On 12 December 2011 11:58, Sarah Goslee <sarah.gos...@gmail.com> wrote: > Did you try this: > > http://r.789695.n4.nabble.com/coloring-leaves-in-a-hclust-or-dendrogram-plot-td795496.html > > or this: > > > http://bioinformatics.mdanderson.org/Software/OOMPA/ClassDiscovery/html/plotColoredClusters.html > > edgetext labels the segments, I think, and is not what I understand > you to want, which is colors for the labels themselves. Thus, the > above suggestions, which I found with about 30 seconds of Googling. > > Sarah > > On Mon, Dec 12, 2011 at 5:10 AM, barbara costa <rbarbar...@gmail.com> > wrote: > > Hello to all, > > I still have this doubt. > > I'd like to colour the different labels of my dendrogram each one with a > > different colour. How can I do? I guess I could do using edgetext and > then > > t.col or lab.col but I don't know how to add edgetext to my dendrogram. > Can > > you help me please? > > > > Example: > > > > require(graphics); require(utils) > > hc <- hclust(dist(USArrests), "ave") > > (dend1 <- as.dendrogram(hc)) > > plot(dend1) > > labels (USArrests) [[1]] # to know how many cities (labels) = 50 > > > > nP <- list(col=3:2, cex=c(2.0, 0.75), pch= 21:22, > > bg= c("light blue", "pink"), > > lab.cex = 0.75, lab.col = 1:50) # or use a palette: > > palette(rainbow(50)) > > > > plot(dend1, edgePar=nP, dLeaf=1, edge.root = TRUE) > > > > # this option is not correct. I want each of my labels (text) have a > > different colour but that is not what is happening. How can I do that? > > > > I'd appreciate your help. > > thanks a lot again. > > Barbara > > > > On 9 December 2011 13:44, barbara costa <rbarbar...@gmail.com> wrote: > >> > >> I'm sorry. > >> > >> (dend1 <- as.dendrogram(hc)) > >> > >> On 9 December 2011 12:10, Sarah Goslee <sarah.gos...@gmail.com> wrote: > >>> > >>> Hi, > >>> > >>> On Fri, Dec 9, 2011 at 6:57 AM, barbara costa <rbarbar...@gmail.com> > >>> wrote: > >>> > Hello to all, > >>> > I'd like to colour the different labels of my dendrogram. How can I > do? > >>> > I > >>> > guess I could to using *edgetext* and then* t.col* or *lab.col* but I > >>> > don't > >>> > know how to add edgetext to my dendrogram. Can you help me please? > >>> > > >>> > Example: > >>> > > >>> > require(graphics); require(utils) > >>> > > >>> > hc <- hclust(dist(USArrests), "ave") > >>> > plot(dend1) > >>> > labels (USArrests) [[1]] # to know how many cities (labels) = 50 > >>> > >>> > >>> > require(graphics); require(utils) > >>> > > >>> > hc <- hclust(dist(USArrests), "ave") > >>> > plot(dend1) > >>> Error in plot(dend1) : object 'dend1' not found > >>> > >>> What's dend1? > >>> > >>> > nP <- list(col=3:2, cex=c(2.0, 0.75), pch= 21:22, > >>> > bg= c("light blue", "pink"), > >>> > lab.cex = 0.75, lab.col = 1:50) # or use a palette: > >>> > palette(rainbow(50)) > >>> > > >>> > plot(dend1, edgePar=nP, dLeaf=1, edge.root = TRUE) > >>> > > >>> > # this option is not correct. I want each of my labels (text) have a > >>> > different colour but that is not what is happening. How can I do > that? > >>> > > >>> > I'd appreciate your help. > >>> > thanks a lot > >>> > Barbara > >>> > > >>> > >>> > >>> -- > >>> Sarah Goslee > >>> http://www.functionaldiversity.org > >> > >> > > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.