Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rect.dendrogram text labels misplacement with horiz = TRUE #25

Open
aravind-j opened this issue Apr 30, 2016 · 3 comments
Open

rect.dendrogram text labels misplacement with horiz = TRUE #25

aravind-j opened this issue Apr 30, 2016 · 3 comments

Comments

@aravind-j
Copy link

Position of text labels by the text = argument in rect.dendrogram is on the horizontal axis rather than the vertical axis when horiz = TRUE.

dend15 <- c(1:5) %>% dist %>% hclust(method = "average") %>% as.dendrogram

par(mar=c(5, 5, 5, 5))

dend15 %>% plot(main="dend15")
dend15 %>% rect.dendrogram(k=3, 
                       border = 8, lty = 5, lwd = 2, text = as.roman(1:3))

dend15 %>% plot(main="dend15", horiz = TRUE)
dend15 %>% rect.dendrogram(k=3, horiz = TRUE,
                       border = 8, lty = 5, lwd = 2, text = as.roman(1:3))
@oriolarques
Copy link

Hi, I have an issue when i use rect.dendrogram() with the text option everything goes fine, however, when I use the option horiz = TRUE text labels do not flip with the dendrogram. Any clues?
Thanks

@talgalili
Copy link
Owner

Thanks everyone for reporting.
I'm not getting to look into it. But if someone would happen to fix it with a PR I'll be happy to review and merge ot.

@talgalili
Copy link
Owner

For future reference, here is how the bug looks like:


dend15 <- c(1:5) %>% dist %>% hclust(method = "average") %>% as.dendrogram

par(mfrow = c(1,2))

dend15 %>% plot(main="dend15")
dend15 %>% rect.dendrogram(k=3, 
                           border = 8, lty = 5, lwd = 2, text = as.roman(1:3))

dend15 %>% plot(main="dend15", horiz = TRUE)
dend15 %>% rect.dendrogram(k=3, horiz = TRUE,
                           border = 8, lty = 5, lwd = 2, text = as.roman(1:3))


image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants