diff --git a/R/plot_utils.R b/R/plot_utils.R index bb8d47d..c9c8b47 100644 --- a/R/plot_utils.R +++ b/R/plot_utils.R @@ -24,11 +24,11 @@ } # Slimmer colorbars with less space -.slim_colorbar <- function(height = 1.2) { +.slim_colorbar <- function(height = 1.2, width = 0.5) { ggplot2::theme( legend.box.spacing = grid::unit(0, "lines"), legend.key.spacing = grid::unit(0.3, "lines"), - legend.key.width = grid::unit(0.5, "lines"), + legend.key.width = grid::unit(width, "lines"), legend.key.height = grid::unit(height, "lines"), legend.ticks.length = ggplot2::rel(0.3) ) diff --git a/R/sv_importance.R b/R/sv_importance.R index 9ceac08..9f526d6 100644 --- a/R/sv_importance.R +++ b/R/sv_importance.R @@ -198,7 +198,8 @@ sv_importance.mshapviz <- function(object, kind = c("bar", "beeswarm", "both", " ) + ggplot2::labs(fill = ggplot2::element_blank()) + do.call(ggplot2::scale_fill_viridis_d, viridis_args) + - ggplot2::guides(fill = ggplot2::guide_legend(reverse = TRUE)) + ggplot2::guides(fill = ggplot2::guide_legend(reverse = TRUE)) + + .slim_colorbar(width = 1) } else { # facets p <- ggplot2::ggplot(imp_df, ggplot2::aes(x = values, y = feature)) + ggplot2::geom_bar(fill = fill, width = bar_width, stat = "identity", ...) + diff --git a/man/figures/VIGNETTE-tidy-class-xgb-imp.png b/man/figures/VIGNETTE-tidy-class-xgb-imp.png index 1c51859..b563f5a 100644 Binary files a/man/figures/VIGNETTE-tidy-class-xgb-imp.png and b/man/figures/VIGNETTE-tidy-class-xgb-imp.png differ