Skip to content

Fix missing default setting for angles in element_grob.element_text(). Closes #2544. #2557

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

Merged
merged 1 commit into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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