Skip to content

Commit 4cf0426

Browse files
committed
rename part_margin() to margin_part()
1 parent ad51647 commit 4cf0426

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ export(layer_sf)
485485
export(lims)
486486
export(map_data)
487487
export(margin)
488+
export(margin_part)
488489
export(max_height)
489490
export(max_width)
490491
export(mean_cl_boot)
@@ -497,7 +498,6 @@ export(new_guide)
497498
export(old_guide)
498499
export(panel_cols)
499500
export(panel_rows)
500-
export(part_margin)
501501
export(pattern_alpha)
502502
export(position_dodge)
503503
export(position_dodge2)

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ggplot2 (development version)
22

33
* Theme margins can have NA-units to inherit from parent elements. The new
4-
function `part_margin()` has NA-units as default (@teunbrand, #6155)
4+
function `margin_part()` has NA-units as default (@teunbrand, #6155)
55
* Built-in `theme_*()` functions now have `ink` and `paper` arguments to control
66
foreground and background colours respectively (@teunbrand)
77
* The `summary()` method for ggplots is now more terse about facets

R/margins.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ margin <- function(t = 0, r = 0, b = 0, l = 0, unit = "pt") {
1111

1212
#' @rdname element
1313
#' @export
14-
part_margin <- function(t = NA, r = NA, b = NA, l = NA, unit = "pt") {
14+
margin_part <- function(t = NA, r = NA, b = NA, l = NA, unit = "pt") {
1515
margin(t = t, r = r, b = b, l = l, unit = unit)
1616
}
1717

R/theme-elements.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' - `element_geom()`: defaults for drawing layers.
1212
#'
1313
#' `rel()` is used to specify sizes relative to the parent,
14-
#' `margin()` and `part_margin()` are used to specify the margins of elements.
14+
#' `margin()` and `margin_part()` are used to specify the margins of elements.
1515
#'
1616
#' @param fill Fill colour.
1717
#' @param colour,color Line/border colour. Color is an alias for colour.

man/element.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-theme.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,16 @@ test_that("complete_theme completes a theme", {
616616
reset_theme_settings()
617617
})
618618

619-
test_that("part_margin() mechanics work as expected", {
619+
test_that("margin_part() mechanics work as expected", {
620620

621621
t <- theme_gray() +
622-
theme(plot.margin = part_margin(b = 11))
622+
theme(plot.margin = margin_part(b = 11))
623623

624624
test <- calc_element("plot.margin", t)
625625
expect_equal(as.numeric(test), c(5.5, 5.5, 11, 5.5))
626626

627627
t <- theme_gray() +
628-
theme(margins = part_margin(b = 11))
628+
theme(margins = margin_part(b = 11))
629629

630630
test <- calc_element("plot.margin", t)
631631
expect_equal(as.numeric(test), c(5.5, 5.5, 11, 5.5))

0 commit comments

Comments
 (0)