From 71c14e5bbee277d72b3172e678a5b8da12cc5487 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sat, 11 Jul 2020 11:14:34 +0900 Subject: [PATCH] Refer to ggplot_global to reduce duplicated codes --- R/scale-binned.R | 4 ++-- R/scale-continuous.r | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/scale-binned.R b/R/scale-binned.R index 7cd8a3f5a1..abb8209ffa 100644 --- a/R/scale-binned.R +++ b/R/scale-binned.R @@ -27,7 +27,7 @@ scale_x_binned <- function(name = waiver(), n.breaks = 10, nice.breaks = TRUE, right = TRUE, show.limits = FALSE, trans = "identity", guide = waiver(), position = "bottom") { binned_scale( - aesthetics = c("x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final", "xlower", "xmiddle", "xupper"), + ggplot_global$x_aes, scale_name = "position_b", palette = identity, name = name, breaks = breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, 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, right = TRUE, show.limits = FALSE, trans = "identity", guide = waiver(), position = "left") { binned_scale( - aesthetics = c("y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final", "lower", "middle", "upper"), + ggplot_global$y_aes, scale_name = "position_b", palette = identity, name = name, breaks = breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, n.breaks = n.breaks, nice.breaks = nice.breaks, right = right, trans = trans, diff --git a/R/scale-continuous.r b/R/scale-continuous.r index 174e0680e7..d6448fcef1 100644 --- a/R/scale-continuous.r +++ b/R/scale-continuous.r @@ -81,7 +81,7 @@ scale_x_continuous <- function(name = waiver(), breaks = waiver(), guide = waiver(), position = "bottom", sec.axis = waiver()) { sc <- continuous_scale( - c("x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final", "xlower", "xmiddle", "xupper", "x0"), + ggplot_global$x_aes, "position_c", identity, name = name, breaks = breaks, n.breaks = n.breaks, minor_breaks = minor_breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, trans = trans, @@ -102,7 +102,7 @@ scale_y_continuous <- function(name = waiver(), breaks = waiver(), guide = waiver(), position = "left", sec.axis = waiver()) { sc <- continuous_scale( - c("y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final", "lower", "middle", "upper", "y0"), + ggplot_global$y_aes, "position_c", identity, name = name, breaks = breaks, n.breaks = n.breaks, minor_breaks = minor_breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, trans = trans,