Skip to content

Commit 6c136a1

Browse files
committed
preserve axis text spacing for theme_minimal()
1 parent d8c96d8 commit 6c136a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/theme-defaults.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ theme_minimal <- function(base_size = 11, base_family = "",
436436
base_rect_size = base_rect_size
437437
) %+replace%
438438
theme(
439-
axis.ticks = element_blank(),
439+
axis.ticks = element_blank(), # Extra margins due to absence ticks
440+
axis.text.x.bottom = element_text(margin = margin(t = 0.45 * base_size)),
441+
axis.text.x.top = element_text(margin = margin(b = 0.45 * base_size)),
442+
axis.text.y.left = element_text(margin = margin(r = 0.45 * base_size)),
443+
axis.text.y.right = element_text(margin = margin(l = 0.45 * base_size)),
440444
legend.background = element_blank(),
441445
legend.key = element_blank(),
442446
panel.background = element_blank(),

0 commit comments

Comments
 (0)