Skip to content

Commit

Permalink
Fix missing default setting for angles in element_grob.element_text().
Browse files Browse the repository at this point in the history
…Closes #2544. (#2557)
  • Loading branch information
clauswilke authored and hadley committed May 7, 2018
1 parent 9034d53 commit 756dfa5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ up correct aspect ratio, and draws a graticule.
to make sure the two legend functions behave as similarly as possible.
(@clauswilke, #2397 and #2398)

* Non-angle parameters of `label.theme` or `title.theme` can now be set in `guide_legend()` and
`guide_colorbar()`. (@clauswilke, #2544)

### Other

Expand Down
5 changes: 1 addition & 4 deletions R/theme-elements.r
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ element_grob.element_text <- function(element, label = "", x = NULL, y = NULL,
hj <- hjust %||% element$hjust
margin <- margin %||% element$margin

angle <- angle %||% element$angle
if (is.null(angle)) {
stop("Text element requires non-NULL value for 'angle'.")
}
angle <- angle %||% element$angle %||% 0

# The gp settings can override element_gp
gp <- gpar(fontsize = size, col = colour,
Expand Down

0 comments on commit 756dfa5

Please sign in to comment.