Skip to content

Commit

Permalink
Fix alignment of leaf labels when rotate=FALSE #28
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Aug 5, 2020
1 parent 785c462 commit 819fa66
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: ggdendro
Version: 0.1.20.9000
Version: 0.1.20.9001
Title: Create Dendrograms and Tree Diagrams Using 'ggplot2'
Description: This is a set of tools for dendrograms and
tree plots using 'ggplot2'. The 'ggplot2' philosophy is to
Expand Down
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
ggdendro dev
============

Bug fixes:

* Fix alignment of leaf labels when rotate=FALSE #28


ggdendro 0.1-16 (Release date: )
==============

Expand Down
4 changes: 2 additions & 2 deletions R/ggdendrogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ggdendrogram <- function(data, segments=TRUE, labels=TRUE, leaf_labels=TRUE,
ifelse(rotate, 90, 0)
}
hjust <- if(dataClass %in% c("dendrogram", "hclust")){
ifelse(rotate, 0, 1)
ifelse(rotate, 1, 1)
} else {
0.5
}
Expand All @@ -67,7 +67,7 @@ ggdendrogram <- function(data, segments=TRUE, labels=TRUE, leaf_labels=TRUE,
}
if(theme_dendro) p <- p + theme_dendro()
p <- p +
theme(axis.text.x = element_text(angle=angle, hjust=1)) +
theme(axis.text.x = element_text(angle=angle, hjust=1, vjust = 0.5)) +
theme(axis.text.y = element_text(angle=angle, hjust=1))

p
Expand Down
Binary file modified man/figures/README-unnamed-chunk-2-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-2-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-2-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 819fa66

Please sign in to comment.