| Title: | Publication-Quality 'ggplot2' Themes |
|---|---|
| Description: | Complete themes and functions for publication-quality 'ggplot2' visualisation. |
| Authors: | David Hodge [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-3868-7501>) |
| Maintainer: | David Hodge <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.0.9000 |
| Built: | 2026-10-13 12:22:53 UTC |
| Source: | https://github.com/davidhodge931/ggrefine |
Note: this sets colour, not fill — fill is the value it reads
from, colour is what it derives. Maps colour to a blended version of
fill, evaluated after scale training via ggplot2::after_scale().
Attaches no scale itself — use scale_colour_blend_discrete() (or
_continuous/_binned) for a ready-to-plot version that also scales
fill. Requires the ggrefine function to be used instead of ggplot2::ggplot to
work where no fill aesthetic is mapped.
aes_colour_blend(blend = NULL)aes_colour_blend(blend = NULL)
blend |
A function that takes a colour vector and returns a blended colour vector. |
A ggplot2 mapping object (as returned by ggplot2::aes()).
Note: this sets colour, not fill — fill is the value it reads
from, colour is what it derives. Maps colour to a dark or light
shade chosen for contrast against the layer's fill aesthetic,
evaluated after scale training via ggplot2::after_scale(). Attaches
no scale itself — sits downstream of whatever fill scale you've
already applied.
aes_colour_contrast(dark = NULL, light = NULL, ...)aes_colour_contrast(dark = NULL, light = NULL, ...)
dark |
A dark colour string or hex value. If |
light |
A light colour string or hex value. If |
... |
Unused. Included to support trailing commas. |
A ggplot2 mapping object (as returned by ggplot2::aes()).
Maps colour to a dark or light shade chosen for contrast against the
active theme's panel (or plot) background fill, evaluated after scale
training via ggplot2::after_scale(). Attaches no scale itself.
aes_colour_panel(dark = NULL, light = NULL, ...)aes_colour_panel(dark = NULL, light = NULL, ...)
dark |
A dark colour string or hex value. If |
light |
A light colour string or hex value. If |
... |
Unused. Included to support trailing commas. |
A ggplot2 mapping object (as returned by ggplot2::aes()).
Note: this sets fill, not colour — colour is the value it reads
from, fill is what it derives. Maps fill to a blended version of
colour, evaluated after scale training via ggplot2::after_scale().
Attaches no scale itself — use scale_fill_blend_discrete() (or
_continuous/_binned) for a ready-to-plot version that also scales
colour.
aes_fill_blend(blend = NULL)aes_fill_blend(blend = NULL)
blend |
A function that takes a colour vector and returns a blended colour vector. |
A ggplot2 mapping object (as returned by ggplot2::aes()).
ggrefine() initializes a plot object using a specified plotting function
(defaults to ggplot2::ggplot()) and pre-populates default identity fill and
colour aesthetic mappings derived from the active theme's geom defaults
(falling back to "grey35" and "black" respectively).
These default aesthetics act as lightweight fallbacks and are cleanly overridden
when explicit mappings are added in subsequent layers via ggplot2::aes().
ggrefine(data = NULL, initialise = ggplot2::ggplot)ggrefine(data = NULL, initialise = ggplot2::ggplot)
data |
Default data frame or graph object to use for plot. If not specified, must be supplied in individual layers. |
initialise |
Function or lambda used to initialize the plot object
(e.g., ggplot2::ggplot, |
A plot object initialized with default aesthetic mappings.
library(ggplot2) library(dplyr) set_theme(ggrefine::theme_lights()) mpg |> count(class) |> ggrefine() + aes(x = class, y = n, fill = class) + geom_col() + scale_colour_blend_discrete()library(ggplot2) library(dplyr) set_theme(ggrefine::theme_lights()) mpg |> count(class) |> ggrefine() + aes(x = class, y = n, fill = class) + geom_col() + scale_colour_blend_discrete()
A single entry point over the axis_mode x grid_mode combinations
previously exposed as sixteen separate refine_*_*() functions. Those
functions still exist internally (e.g. .refine_modern_drift()) and do
the actual work; this function just dispatches to the right one.
refine_axis_grid( discrete, orientation = NULL, axis_mode = "modern", grid_mode = "drift" )refine_axis_grid( discrete, orientation = NULL, axis_mode = "modern", grid_mode = "drift" )
discrete |
Character. Which axes should be treated as discrete for
refinement purposes: |
orientation |
Character. The primary axis of interest: |
axis_mode |
Character. One of |
grid_mode |
Character. One of |
axis_mode controls what happens to axis lines, ticks, text, and titles:
Removes ticks on discrete axes only.
Like classic, plus removes the axis line and ticks on
the non-orientation axis.
Removes all axis lines and ticks, regardless of orientation or discreteness.
Like minimal, plus removes all axis text and titles.
grid_mode controls what happens to panel gridlines:
Leaves panel gridlines unchanged.
Removes gridlines on the orientation axis, but only when at least one axis is discrete.
Removes gridlines on the orientation axis unconditionally.
Removes all panel gridlines.
A ggplot2 theme object.
Helper shortcut to set legend position, location, and margins.
refine_legend(position = "right")refine_legend(position = "right")
position |
Character. Where to place the legend ("right", "top", or "bottom"). |
A ggplot2 theme object.
Scales fill with a binned colour scale, and additionally maps colour
to a blended version of the resulting fill, via aes_colour_blend().
The colour legend is suppressed since fill already communicates the
mapping.
scale_colour_blend_binned(blend = NULL, ...)scale_colour_blend_binned(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a binned
colour/fill scale, and a guide) that can be added to a ggplot object.
Scales fill with a continuous colour scale, and additionally maps
colour to a blended version of the resulting fill, via
aes_colour_blend(). The colour legend is suppressed since fill
already communicates the mapping.
scale_colour_blend_continuous(blend = NULL, ...)scale_colour_blend_continuous(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a continuous
colour/fill scale, and a guide) that can be added to a ggplot object.
Scales fill with a discrete colour scale, and additionally maps
colour to a blended version of the resulting fill, via
aes_colour_blend(). The colour legend is suppressed since fill
already communicates the mapping.
scale_colour_blend_discrete(blend = NULL, ...)scale_colour_blend_discrete(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a discrete
colour/fill scale, and a guide) that can be added to a ggplot object.
Scales colour with a binned colour scale, and additionally maps fill
to a blended version of the resulting colour, via aes_fill_blend().
The fill legend is suppressed since colour already communicates the
mapping.
scale_fill_blend_binned(blend = NULL, ...)scale_fill_blend_binned(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a binned
colour/fill scale, and a guide) that can be added to a ggplot object.
Scales colour with a continuous colour scale, and additionally maps
fill to a blended version of the resulting colour, via
aes_fill_blend(). The fill legend is suppressed since colour
already communicates the mapping.
scale_fill_blend_continuous(blend = NULL, ...)scale_fill_blend_continuous(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a continuous
colour/fill scale, and a guide) that can be added to a ggplot object.
Scales colour with a discrete colour scale, and additionally maps
fill to a blended version of the resulting colour, via
aes_fill_blend(). The fill legend is suppressed since colour
already communicates the mapping.
scale_fill_blend_discrete(blend = NULL, ...)scale_fill_blend_discrete(blend = NULL, ...)
blend |
A function that takes a colour vector and returns a blended colour vector. |
... |
Additional arguments passed on to
|
A list of ggplot2 components (a mapping, a discrete
colour/fill scale, and a guide) that can be added to a ggplot object.
A convenience wrapper around ggplot2::scale_x_continuous() that sets the
lower limit of the x-axis strictly to zero with no padding by default, while
allowing full customization of scale parameters.
scale_x_zero(expand = ggplot2::expansion(c(0, 0.05)), limits = c(0, NA), ...)scale_x_zero(expand = ggplot2::expansion(c(0, 0.05)), limits = c(0, NA), ...)
expand |
Padding multiplier/addend vector. Defaults to |
limits |
Axis limits. Defaults to |
... |
Additional arguments passed on to |
A ScaleContinuousPosition object.
A convenience wrapper around ggplot2::scale_y_continuous() that sets the
lower limit of the y-axis strictly to zero with no padding by default, while
allowing full customization of scale parameters.
scale_y_zero(expand = ggplot2::expansion(c(0, 0.05)), limits = c(0, NA), ...)scale_y_zero(expand = ggplot2::expansion(c(0, 0.05)), limits = c(0, NA), ...)
expand |
Padding multiplier/addend vector. Defaults to |
limits |
Axis limits. Defaults to |
... |
Additional arguments passed on to |
A ScaleContinuousPosition object.
A complete theme with a dark plot and panel background. Uses flexoki inspired colours.
theme_darks( ..., text_size = 10, text_family = "", text_colour = "#CECDC3", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "#282726", panel_grid_colour = "#100F0F", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "#100F0F" )theme_darks( ..., text_size = 10, text_family = "", text_colour = "#CECDC3", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "#282726", panel_grid_colour = "#100F0F", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "#100F0F" )
... |
Require named arguments (and support trailing commas). |
text_size |
The base size of the text theme element. Defaults to 10. |
text_family |
The base family of the text theme element. Defaults to "". |
text_colour |
The base colour of the text theme element. |
title_size |
The size of the |
title_family |
The family of the |
title_colour |
The colour of the |
subtitle_size |
The size of the |
subtitle_family |
The family of the |
subtitle_colour |
The colour of the |
caption_size |
The size of the |
caption_family |
The family of the |
caption_colour |
The colour of the |
caption_hjust |
The horizontal justification of the |
legend_position |
The position of the legend. Either "right", "top" or "bottom". |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. |
legend_axis_line_linewidth |
The linewidth of the legend.axis.line theme element. |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. |
legend_ticks_colour |
The colour of the legend.ticks theme element. |
legend_ticks_linewidth |
The linewidth of the legend.ticks theme element. |
legend_ticks_linetype |
The linetype of the legend.ticks theme element. Defaults to 1. |
legend_ticks_length |
The length of the legend.ticks.length theme element. |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_line_linewidth |
The linewidth of the axis.line theme element. |
axis_ticks_colour |
The colour of the axis.ticks theme element. |
axis_ticks_linewidth |
The linewidth of the axis.ticks theme element. |
axis_ticks_length |
The length of the axis.ticks.length theme element. |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
panel_grid_linetype |
The linetype of the panel.grid.major theme element. |
panel_grid_linewidth |
The linewidth of the panel.grid.major theme element. |
panel_grid_minor_linetype |
The linetype of the panel.grid.minor theme element. |
panel_grid_minor_linewidth |
The linewidth of the panel.grid.minor theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Dark theme
A ggplot theme.
A complete theme with a light grey panel background and white panel grid colour. Uses flexoki inspired colours.
theme_greys( ..., text_size = 10, text_family = "", text_colour = "#100F0F", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "#F2F0E5FF", panel_grid_colour = "white", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "white" )theme_greys( ..., text_size = 10, text_family = "", text_colour = "#100F0F", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "#F2F0E5FF", panel_grid_colour = "white", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "white" )
... |
Require named arguments (and support trailing commas). |
text_size |
The base size of the text theme element. Defaults to 10. |
text_family |
The base family of the text theme element. Defaults to "". |
text_colour |
The base colour of the text theme element. |
title_size |
The size of the |
title_family |
The family of the |
title_colour |
The colour of the |
subtitle_size |
The size of the |
subtitle_family |
The family of the |
subtitle_colour |
The colour of the |
caption_size |
The size of the |
caption_family |
The family of the |
caption_colour |
The colour of the |
caption_hjust |
The horizontal justification of the |
legend_position |
The position of the legend. Either "right", "top" or "bottom". |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. |
legend_axis_line_linewidth |
The linewidth of the legend.axis.line theme element. |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. |
legend_ticks_colour |
The colour of the legend.ticks theme element. |
legend_ticks_linewidth |
The linewidth of the legend.ticks theme element. |
legend_ticks_linetype |
The linetype of the legend.ticks theme element. Defaults to 1. |
legend_ticks_length |
The length of the legend.ticks.length theme element. |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_line_linewidth |
The linewidth of the axis.line theme element. |
axis_ticks_colour |
The colour of the axis.ticks theme element. |
axis_ticks_linewidth |
The linewidth of the axis.ticks theme element. |
axis_ticks_length |
The length of the axis.ticks.length theme element. |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
panel_grid_linetype |
The linetype of the panel.grid.major theme element. |
panel_grid_linewidth |
The linewidth of the panel.grid.major theme element. |
panel_grid_minor_linetype |
The linetype of the panel.grid.minor theme element. |
panel_grid_minor_linewidth |
The linewidth of the panel.grid.minor theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Grey theme
A ggplot theme.
A complete theme with a white panel background and a light panel grid colour. Uses flexoki inspired colours.
theme_lights( ..., text_size = 10, text_family = "", text_colour = "#100F0F", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "white", panel_grid_colour = "#F2F0E5", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "white" )theme_lights( ..., text_size = 10, text_family = "", text_colour = "#100F0F", title_size = NULL, title_family = NULL, title_colour = NULL, subtitle_size = NULL, subtitle_family = NULL, subtitle_colour = NULL, caption_size = NULL, caption_family = NULL, caption_colour = NULL, caption_hjust = 0, legend_position = "right", legend_axis_line_colour = NULL, legend_axis_line_linewidth = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, legend_ticks_linewidth = NULL, legend_ticks_linetype = 1, legend_ticks_length = grid::unit(c(2.75, 0), "pt"), axis_line_colour = NULL, axis_line_linewidth = 0.15, axis_ticks_colour = NULL, axis_ticks_linewidth = NULL, axis_ticks_length = grid::unit(3.66, "pt"), panel_background_fill = "white", panel_grid_colour = "#F2F0E5", panel_grid_linetype = 1, panel_grid_linewidth = 1, panel_grid_minor_linetype = 1, panel_grid_minor_linewidth = 0.5, plot_background_fill = "white" )
... |
Require named arguments (and support trailing commas). |
text_size |
The base size of the text theme element. Defaults to 10. |
text_family |
The base family of the text theme element. Defaults to "". |
text_colour |
The base colour of the text theme element. |
title_size |
The size of the |
title_family |
The family of the |
title_colour |
The colour of the |
subtitle_size |
The size of the |
subtitle_family |
The family of the |
subtitle_colour |
The colour of the |
caption_size |
The size of the |
caption_family |
The family of the |
caption_colour |
The colour of the |
caption_hjust |
The horizontal justification of the |
legend_position |
The position of the legend. Either "right", "top" or "bottom". |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. |
legend_axis_line_linewidth |
The linewidth of the legend.axis.line theme element. |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. |
legend_ticks_colour |
The colour of the legend.ticks theme element. |
legend_ticks_linewidth |
The linewidth of the legend.ticks theme element. |
legend_ticks_linetype |
The linetype of the legend.ticks theme element. Defaults to 1. |
legend_ticks_length |
The length of the legend.ticks.length theme element. |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_line_linewidth |
The linewidth of the axis.line theme element. |
axis_ticks_colour |
The colour of the axis.ticks theme element. |
axis_ticks_linewidth |
The linewidth of the axis.ticks theme element. |
axis_ticks_length |
The length of the axis.ticks.length theme element. |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
panel_grid_linetype |
The linetype of the panel.grid.major theme element. |
panel_grid_linewidth |
The linewidth of the panel.grid.major theme element. |
panel_grid_minor_linetype |
The linetype of the panel.grid.minor theme element. |
panel_grid_minor_linewidth |
The linewidth of the panel.grid.minor theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Lights theme
A ggplot theme.
Updates the currently active/set theme in place with the
colours of theme_darks(), via ggplot2::theme_update(). Useful for
recolouring every plot for the rest of the session without swapping out
the full theme.
update_darks( ..., text_colour = "#CECDC3", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "#282726", panel_grid_colour = "#100F0F", plot_background_fill = "#100F0F" )update_darks( ..., text_colour = "#CECDC3", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "#282726", panel_grid_colour = "#100F0F", plot_background_fill = "#100F0F" )
... |
Require named arguments (and support trailing commas). |
text_colour |
The base colour of the text theme element. |
title_colour |
The colour of the |
subtitle_colour |
The colour of the |
caption_colour |
The colour of the |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_ticks_colour |
The colour of the axis.ticks theme element. Defaults to |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. Defaults to |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. Defaults to |
legend_ticks_colour |
The colour of the legend.ticks theme element. Defaults to |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Update the set theme (Darks)
The previous theme, invisibly (see ggplot2::theme_update()).
Updates the currently active/set theme in place with the
colours of theme_greys(), via ggplot2::theme_update(). Useful for
recolouring every plot for the rest of the session without swapping out
the full theme.
update_greys( ..., text_colour = "#100F0F", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "#F2F0E5FF", panel_grid_colour = "white", plot_background_fill = "white" )update_greys( ..., text_colour = "#100F0F", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "#F2F0E5FF", panel_grid_colour = "white", plot_background_fill = "white" )
... |
Require named arguments (and support trailing commas). |
text_colour |
The base colour of the text theme element. |
title_colour |
The colour of the |
subtitle_colour |
The colour of the |
caption_colour |
The colour of the |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_ticks_colour |
The colour of the axis.ticks theme element. Defaults to |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. Defaults to |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. Defaults to |
legend_ticks_colour |
The colour of the legend.ticks theme element. Defaults to |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Update the set theme (greys)
The previous theme, invisibly (see ggplot2::theme_update()).
Updates the currently active/set theme in place with the
colours of theme_lights(), via ggplot2::theme_update(). Useful for
recolouring every plot for the rest of the session without swapping out
the full theme.
update_lights( ..., text_colour = "#100F0F", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "white", panel_grid_colour = "#F2F0E5", plot_background_fill = "white" )update_lights( ..., text_colour = "#100F0F", title_colour = NULL, subtitle_colour = NULL, caption_colour = NULL, axis_line_colour = NULL, axis_ticks_colour = NULL, legend_axis_line_colour = NULL, legend_background_fill = NULL, legend_key_fill = NULL, legend_ticks_colour = NULL, panel_background_fill = "white", panel_grid_colour = "#F2F0E5", plot_background_fill = "white" )
... |
Require named arguments (and support trailing commas). |
text_colour |
The base colour of the text theme element. |
title_colour |
The colour of the |
subtitle_colour |
The colour of the |
caption_colour |
The colour of the |
axis_line_colour |
The colour of the axis.line theme element. Defaults to |
axis_ticks_colour |
The colour of the axis.ticks theme element. Defaults to |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. Defaults to |
legend_background_fill |
The fill (and colour) of the |
legend_key_fill |
The fill (and colour) of the legend.key theme element. Defaults to |
legend_ticks_colour |
The colour of the legend.ticks theme element. Defaults to |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
Update the set theme (Lights)
The previous theme, invisibly (see ggplot2::theme_update()).
Modifies active theme settings for fixed, discrete, and continuous palettes only for parameters explicitly provided by the user.
update_palette(fixed = NULL, discrete = NULL, continuous = NULL)update_palette(fixed = NULL, discrete = NULL, continuous = NULL)
fixed |
Colour applied to geometric elements via |
discrete |
Palette specification (e.g., |
continuous |
Palette specification for continuous scales
( |
Invisibly returns the result of the theme_update() calls.
## Not run: # Update fixed geom colour update_palette(fixed = "steelblue") # Update discrete palette update_palette(discrete = scales::pal_hue()) # Update continuous palette update_palette(continuous = scales::pal_viridis()) ## End(Not run)## Not run: # Update fixed geom colour update_palette(fixed = "steelblue") # Update discrete palette update_palette(discrete = scales::pal_hue()) # Update continuous palette update_palette(continuous = scales::pal_viridis()) ## End(Not run)
Modifies panel dimensions such as heights and widths by updating the global theme settings.
update_panel_size(heights = ggplot2::waiver(), widths = ggplot2::waiver())update_panel_size(heights = ggplot2::waiver(), widths = ggplot2::waiver())
heights |
A |
widths |
A |
Invisibly returns the updated theme object.
## Not run: update_panel_size( heights = grid::unit(6, "cm"), widths = grid::unit(8, "cm") ) ## End(Not run)## Not run: update_panel_size( heights = grid::unit(6, "cm"), widths = grid::unit(8, "cm") ) ## End(Not run)