diff --git a/R/methods.R b/R/methods.R index 6df8c44a1..c42f99d6d 100644 --- a/R/methods.R +++ b/R/methods.R @@ -1105,8 +1105,15 @@ plot.vsel <- function( x_color_txt <- "black" } pp <- pp + - geom_text(aes(y = -Inf, label = .data[["size_chr"]]), vjust = -0.5, - color = x_color_txt) + if (packageVersion("ggplot2") < "4.0.0") { + geom_text(aes(y = -Inf, label = .data[["size_chr"]]), vjust = -0.5, + color = x_color_txt) + } else { + geom_text(aes(y = -Inf, label = .data[["size_chr"]], + size = from_theme(fontsize * 0.7)), + vjust = -0.5, color = x_color_txt) + + } } # Miscellaneous stuff (axes, theming, faceting, etc.): if (!is.na(ranking_nterms_max) && ranking_colored &&