A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ScotGovAnalysis.github.io/sgplot/articles/../reference/use_sgplot.html below:

Use sgplot defaults. — use_sgplot • sgplot

Set sgplot theme, colour palette and geom aesthetic defaults for ggplot2 charts.

Usage
use_sgplot(palette_type = "sg", ..., default_colour = deprecated())
Arguments
palette_type

Name of palette type to use. Defaults to "sg". For all available palette types, run available_palette_types().

...

Arguments passed to sgplot::theme_sg().

default_colour

Use the palette_type argument instead.

Value

NULL. Function is used for side effects of setting default ggplot2 theme, colour palette and geom aesthetics.

Examples
library(ggplot2)

d <- subset(mpg, manufacturer == "ford")

# ggplot2 defaults
ggplot(d, aes(x = model)) + geom_bar()

ggplot(d, aes(x = model, fill = class)) + geom_bar()


# Use sgplot defaults
use_sgplot()
#>  Default ggplot2 theme set to `theme_sg`.
#>  Default colours set to "sg" palettes.
#>  Default geom aesthetics set.
ggplot(d, aes(x = model)) + geom_bar()

ggplot(d, aes(x = model, fill = class, colour = class)) + geom_bar()


# Use sgplot defaults and Social Security Scotland colour palettes
use_sgplot(palette_type = "sss")
#>  Default ggplot2 theme set to `theme_sg`.
#>  Default colours set to "sss" palettes.
#>  Default geom aesthetics set.
ggplot(d, aes(x = model)) + geom_bar()

ggplot(d, aes(x = model, fill = class, colour = class)) + geom_bar()



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4