joris meys
2009-Nov-16 12:28 UTC
[R] Labels in horizontal dendrogram not placed correctly?
Hi all,
I tried plotting a horizontal dendrogram, but it seems as if the
labels are not taken into account in the function plot.dendrogram().
A minimal example :
Test <- data.frame(
x10000x = c(1:10),
x20000x = c(2:11),
x30000x = c(11:2)
)
TestDist <- daisy(data.frame(t(Test)))
TestAgnes <- agnes(TestDist)
plot(as.dendrogram(TestAgnes),horiz=T)
If I run this in R 2.10.0, I get a horizontal dendrogram with the
labels to the far right, and partly outside the plot area. This is
highly inconvenient. Am I doing something wrong or is this a bug?
Kind regards
Joris
Chris Campbell
2009-Nov-19 05:46 UTC
[R] Labels in horizontal dendrogram not placed correctly?
On Mon, Nov 16, 2009 at 07:28, joris meys <jorismeys at gmail.com> wrote:> Hi all, > > I tried plotting a horizontal dendrogram, but it seems as if the > labels are not taken into account in the function plot.dendrogram(). > > A minimal example : > Test <- data.frame( > ? ?x10000x = c(1:10), > ? ?x20000x = c(2:11), > ? ?x30000x = c(11:2) > ) > > TestDist <- daisy(data.frame(t(Test))) > TestAgnes <- agnes(TestDist) > plot(as.dendrogram(TestAgnes),horiz=T) > > If I run this in R 2.10.0, I get a horizontal dendrogram with the > labels to the far right, and partly outside the plot area. This is > highly inconvenient. Am I doing something wrong or is this a bug? > > Kind regards > Joris > > ______________________________________________ > R-help at 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. >Extend your right margin before plotting and you will be able to see the labels: par(mar=c(5.1, 4.1, 4.1, 5.1)) plot(as.dendrogram(TestAgnes),horiz=T)