Skip to content

Commit f72eeca

Browse files
committed
Minor cleaning
1 parent 24dd121 commit f72eeca

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

R/helpers-gg.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ force_axes_in_facets <- function() {
2222
no_legend_spacing <- function() {
2323
theme(legend.spacing.y = unit(0, "cm"))
2424
}
25+
reduce_legend_spacing <- function(cm) {
26+
theme(legend.spacing.y = unit(-cm, "cm"))
27+
}
2528
space_legend_keys <- function(relative_size = 2, color = "white") {
2629
theme(legend.key = element_rect(size = rel(relative_size), color = color))
2730
}

R/mcmc-recover.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ mcmc_recover_hist <-
331331
guides(color = guide_legend(), fill = guide_legend(order = 1)) +
332332
dont_expand_y_axis() +
333333
theme_default() +
334-
theme(legend.spacing.y = unit(-0.25, "cm")) +
334+
reduce_legend_spacing(0.25) +
335335
xaxis_title(FALSE) +
336336
yaxis_text(FALSE) +
337337
yaxis_ticks(FALSE) +

R/ppc-discrete.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ ppc_rootogram <- function(y,
272272

273273
graph +
274274
theme_default() +
275-
theme(legend.spacing.y = unit(-0.25, "cm"))
275+
reduce_legend_spacing(0.25)
276276
}
277277

278278

@@ -388,6 +388,6 @@ ppc_bars_yrep_data <- function(y, yrep, probs, freq = TRUE, group = NULL) {
388388

389389
graph +
390390
theme_default() +
391-
theme(legend.spacing.y = unit(-0.25, "cm"))
391+
reduce_legend_spacing(0.25)
392392
}
393393

0 commit comments

Comments
 (0)