Closed davidhodge931 closed 5 months ago
ggplot2::update_geom_defaults enables users to set default aesthetics for when an aesthetic variable is not set.
ggplot2::update_geom_defaults
This is super useful for typing less.
I use these functions in ggblanket with a set_blanket function which sets default colour, fill, alpha and linewidth.
set_blanket
library(tidyverse) library(palmerpenguins) library(ggblanket) update_geom_defaults("boxplot", aes(colour = "red", fill = "blue". alpha = 0.5, linewidth = 0.66) ) p <- penguins |> ggplot(aes(x = species, y = body_mass_g)) + geom_boxplot() p canvasXpress::canvasXpress(p)
Those properties are not in the ggplot object. Where do you store them?
Each geom has its defaults stored in it's ggproto object.
E.g. ggplot2::GeomBoxplot$default_aes
ggplot2::GeomBoxplot$default_aes
Fixed in 49.1
ggplot2::update_geom_defaults
enables users to set default aesthetics for when an aesthetic variable is not set.This is super useful for typing less.
I use these functions in ggblanket with a
set_blanket
function which sets default colour, fill, alpha and linewidth.