diff --git a/R/scale-product.R b/R/scale-product.R index 299b220..548bf87 100644 --- a/R/scale-product.R +++ b/R/scale-product.R @@ -31,7 +31,15 @@ product_labels <- function() { is.waive <- getFromNamespace("is.waive", "ggplot2") - +## Internal: Fix for change in ggplot_3.3 +.default_guide <- function() { + if (utils::packageVersion("ggplot2") <= "3.2.1") { + "none" + } else { + ggplot2::waiver() + } +} + #' Helper function for determining scales #' @@ -66,7 +74,7 @@ scale_x_productlist <- function(name = product_names(), breaks = product_breaks( "position_c", identity, name = name, breaks = breaks, minor_breaks = minor_breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, trans = trans, - guide = "none", position = position, super = ScaleContinuousProduct + guide = .default_guide(), position = position, super = ScaleContinuousProduct ) if (!is.waive(sec.axis)) { @@ -93,7 +101,7 @@ scale_y_productlist <- function(name = product_names(), breaks = product_breaks( "position_c", identity, name = name, breaks = breaks, minor_breaks = minor_breaks, labels = labels, limits = limits, expand = expand, oob = oob, na.value = na.value, trans = trans, - guide = "none", position = position, super = ScaleContinuousProduct + guide = .default_guide(), position = position, super = ScaleContinuousProduct ) if (!is.waive(sec.axis)) {