Skip to content

Commit 756dfa5

Browse files
clauswilkehadley
authored andcommitted
Fix missing default setting for angles in element_grob.element_text(). Closes #2544. (#2557)
1 parent 9034d53 commit 756dfa5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ up correct aspect ratio, and draws a graticule.
328328
to make sure the two legend functions behave as similarly as possible.
329329
(@clauswilke, #2397 and #2398)
330330

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

332334
### Other
333335

R/theme-elements.r

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ element_grob.element_text <- function(element, label = "", x = NULL, y = NULL,
203203
hj <- hjust %||% element$hjust
204204
margin <- margin %||% element$margin
205205

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

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

0 commit comments

Comments
 (0)