Skip to content

Commit 3e133af

Browse files
committed
panel.margin -> panel.spacing
1 parent 6e95940 commit 3e133af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/ggplotly.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ gg2list <- function(p, width = NULL, height = NULL, tooltip = "all",
347347
# panel margins must be computed before panel/axis loops
348348
# (in order to use get_domains())
349349
panelMarginX <- unitConvert(
350-
theme[["panel.margin.x"]] %||% theme[["panel.margin"]],
350+
theme[["panel.spacing.x"]] %||% theme[["panel.spacing"]],
351351
"npc", "width"
352352
)
353353
panelMarginY <- unitConvert(
354-
theme[["panel.margin.y"]] %||% theme[["panel.margin"]],
354+
theme[["panel.spacing.y"]] %||% theme[["panel.spacing"]],
355355
"npc", "height"
356356
)
357357
# space for _interior_ facet strips

tests/testthat/test-ggplot-facets.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test_that("6 facets becomes 6 panels", {
55
gg <- qplot(yield, variety, data = barley,
66
color = year, facets = site ~ ., pch = I(1))+
77
theme_bw() +
8-
theme(panel.margin = grid::unit(0, "cm"))
8+
theme(panel.spacing = grid::unit(0, "cm"))
99
info <- save_outputs(gg, "barley")
1010
# two legend entries, but two groups
1111
expect_equal(sum(sapply(info$data, "[[", "showlegend")), 2)
@@ -25,7 +25,7 @@ test_that("3 facets becomes 3 panels", {
2525
)
2626
gg <- qplot(x, y, data = df, facets = z ~ ., pch = I(1)) +
2727
theme_bw() +
28-
theme(panel.margin = grid::unit(0, "cm"))
28+
theme(panel.spacing = grid::unit(0, "cm"))
2929
info <- save_outputs(gg, "3-panels")
3030
yaxes <- sapply(info$data, "[[", "yaxis")
3131
xaxes <- sapply(info$data, "[[", "xaxis")

0 commit comments

Comments
 (0)