Skip to content

Commit 4a8c827

Browse files
Refer to ggplot_global to reduce duplicated codes (tidyverse#4129)
1 parent cc7ac3b commit 4a8c827

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/scale-binned.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ scale_x_binned <- function(name = waiver(), n.breaks = 10, nice.breaks = TRUE,
2727
right = TRUE, show.limits = FALSE, trans = "identity",
2828
guide = waiver(), position = "bottom") {
2929
binned_scale(
30-
aesthetics = c("x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final", "xlower", "xmiddle", "xupper"),
30+
ggplot_global$x_aes,
3131
scale_name = "position_b", palette = identity, name = name, breaks = breaks,
3232
labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value,
3333
n.breaks = n.breaks, nice.breaks = nice.breaks, right = right, trans = trans,
@@ -44,7 +44,7 @@ scale_y_binned <- function(name = waiver(), n.breaks = 10, nice.breaks = TRUE,
4444
right = TRUE, show.limits = FALSE, trans = "identity",
4545
guide = waiver(), position = "left") {
4646
binned_scale(
47-
aesthetics = c("y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final", "lower", "middle", "upper"),
47+
ggplot_global$y_aes,
4848
scale_name = "position_b", palette = identity, name = name, breaks = breaks,
4949
labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value,
5050
n.breaks = n.breaks, nice.breaks = nice.breaks, right = right, trans = trans,

R/scale-continuous.r

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ scale_x_continuous <- function(name = waiver(), breaks = waiver(),
8181
guide = waiver(), position = "bottom",
8282
sec.axis = waiver()) {
8383
sc <- continuous_scale(
84-
c("x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final", "xlower", "xmiddle", "xupper", "x0"),
84+
ggplot_global$x_aes,
8585
"position_c", identity, name = name, breaks = breaks, n.breaks = n.breaks,
8686
minor_breaks = minor_breaks, labels = labels, limits = limits,
8787
expand = expand, oob = oob, na.value = na.value, trans = trans,
@@ -102,7 +102,7 @@ scale_y_continuous <- function(name = waiver(), breaks = waiver(),
102102
guide = waiver(), position = "left",
103103
sec.axis = waiver()) {
104104
sc <- continuous_scale(
105-
c("y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final", "lower", "middle", "upper", "y0"),
105+
ggplot_global$y_aes,
106106
"position_c", identity, name = name, breaks = breaks, n.breaks = n.breaks,
107107
minor_breaks = minor_breaks, labels = labels, limits = limits,
108108
expand = expand, oob = oob, na.value = na.value, trans = trans,

0 commit comments

Comments
 (0)