set_blanket | R Documentation |
Set the style by setting:
the theme, and how/what side-effects are to be applied
the geom defaults, including the colour (and fill) of geoms
the geom colour (and fill) palettes (i.e. discrete, continuous and ordinal)
the function to apply to a unspecified/unlabelled x_label
, y_label
, col_label
etc.
ggplot2::update_geom_defaults()
can be used to further fine-tune geom defaults.
set_blanket(
...,
theme = light_mode_r(),
theme_orientation = NULL,
theme_axis_line_rm = TRUE,
theme_axis_ticks_rm = TRUE,
theme_panel_grid_rm = TRUE,
col_palette_d = jumble,
col_palette_c = viridisLite::mako(n = 9, direction = -1),
col_palette_o = scales::pal_viridis(option = "G", direction = -1),
col_palette_na_d = "#CDC5BFFF",
col_palette_na_c = "#988F88FF",
col_palette_na_o = "#988F88FF",
colour = "#357BA2FF",
fill = colour,
linewidth = 0.66,
label_case = snakecase::to_sentence_case
)
... |
Provided to require argument naming, support trailing commas etc. |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that can be removed by the |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
col_palette_d |
For a discrete scale, a character vector of hex codes. |
col_palette_c |
For a continuous scale, a character vector of hex codes. |
col_palette_o |
For an ordinal scale, a |
col_palette_na_d |
For a discrete scale, a hex code. |
col_palette_na_c |
For a continuous scale, a hex code. |
col_palette_na_o |
For an ordinal scale, a hex code. |
colour |
A default hex code for the colour of geoms (i.e. geoms other than "text", "label", "hline", and "vline"). Note, the "fill" inherits from this argument. |
fill |
A default hex code for the fill of relevant geoms (i.e. geoms other than "label"). Inherits from colour. |
linewidth |
A numeric linewidth (i.e. for geoms that are polygons, and do not potentially have necessary adjacent lines - these get a linewidth of 0). Defaults to 0.66. |
label_case |
A function to apply to a unspecified/unlabelled |
A globally set style.
library(ggplot2)
library(ggblanket)
library(palmerpenguins)
set_blanket(
theme = dark_mode_r(),
colour = "#E7298AFF",
col_palette_d = c("#1B9E77FF", "#D95F02FF", "#7570b3FF", "#E7298AFF",
"#66A61EFF", "#E6AB02FF", "#A6761DFF", "#666666FF"),
)
penguins |>
gg_point(
x = flipper_length_mm,
y = body_mass_g,
)
penguins |>
gg_histogram(
x = flipper_length_mm,
col = species,
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.