diff --git a/DESCRIPTION b/DESCRIPTION index 9ed47eef1..aa914a632 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: see Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2' -Version: 0.10.0.1 +Version: 0.10.0.3 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/R/plot.visualisation_recipe.R b/R/plot.visualisation_recipe.R index dd8e81ea6..7b3f701bf 100644 --- a/R/plot.visualisation_recipe.R +++ b/R/plot.visualisation_recipe.R @@ -7,8 +7,16 @@ plot.see_visualisation_recipe <- function(x, ...) { } suppressWarnings(ggraph::ggraph(attributes(x)$data, layout = attributes(x)$layout) + geoms_from_list(x)) } else { - suppressWarnings(ggplot2::ggplot(data = attributes(x)$data) + - geoms_from_list(x, ...)) + global_aes <- attributes(x)$global_aes + if (!is.null(global_aes) && length(global_aes)) { + global_aes <- do.call(ggplot2::aes, args = lapply(global_aes, .str_to_sym)) + } + suppressWarnings( + do.call( + ggplot2::ggplot, + insight::compact_list(list(data = attributes(x)$data, mapping = global_aes)) + ) + geoms_from_list(x, ...) + ) } }