[R] Labels in horizontal dendrogram not placed correctly?

joris meys jorismeys at gmail.com
Tue Nov 24 17:08:32 CET 2009


Thx Chris, extending the margins worked like a charm. It would be nice
though if the plot function would take the length of the labels into
account as well, but I guess I'm just being too much of a spoiled kid
here ;-)

Cheers
Joris

On Thu, Nov 19, 2009 at 6:46 AM, Chris Campbell <clc559 at gmail.com> wrote:
> 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)
>




More information about the R-help mailing list