Skip to content

Commit a277e38

Browse files
committed
Merge branch 'fix/theme_void' of https://github.com/jiho/ggplot2 into jiho-fix/theme_void
2 parents 61f99b3 + c1c0d2c commit a277e38

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
* `stat_ecdf()` does a better job of adding padding to -Inf/Inf, and gains
2020
an argument `pad` to suppress the padding if not needed (#1467).
2121

22+
* `theme_void()` was completely void of text but facets and legends still
23+
needed labels. They are now visible (@jiho).
24+
2225
* Multipanel empty data is correctly plotted, rather than throwing an unhelpful
2326
error (#1445).
2427

R/theme-defaults.r

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,20 @@ theme_void <- function(base_size = 12, base_family = "") {
269269
# Use only inherited elements and make everything blank
270270
line = element_blank(),
271271
rect = element_blank(),
272-
text = element_blank(),
272+
text = element_text(
273+
family = base_family, face = "plain",
274+
colour = "black", size = base_size,
275+
lineheight = 0.9, hjust = 0.5, vjust = 0.5, angle = 0,
276+
margin = margin(), debug = FALSE
277+
),
273278
plot.margin = unit(c(0, 0, 0, 0), "lines"),
279+
axis.text.x = element_blank(),
280+
axis.text.y = element_blank(),
281+
axis.title.x = element_blank(),
282+
axis.title.y = element_blank(),
283+
legend.text = element_text(size = rel(0.8)),
284+
legend.title = element_blank(),
285+
strip.text = element_text(size = rel(0.8)),
274286

275287
complete = TRUE
276288
)

tests/testthat/Rplots.pdf

-3.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)