Learn R Programming

speccurvieR (version 1.0.0)

theme_sca: A clean, consistent ggplot2 theme for speccurvieR plots.

Description

`theme_sca()` is the shared theme applied by the package's plotting functions. It is exported so the same look can be reused or tweaked when customising the plots they return.

Usage

theme_sca(
  base_size = 11,
  base_family = getOption("speccurvieR.base_family", "")
)

Value

A ggplot2 theme object.

Arguments

base_size

Base font size, passed to [ggplot2::theme_minimal()]. Defaults to `11`.

base_family

Base font family, passed to [ggplot2::theme_minimal()]. Defaults to the value of the `speccurvieR.base_family` option, or `""` (the graphics device's default font) if that option is unset, so plots stay portable across machines. Set the option (e.g. `options(speccurvieR.base_family = "Roboto")`) or pass a family directly to use a specific font.

Examples

Run this code
library(ggplot2)
ggplot(bottles, aes(T_degC, Salnty)) + geom_point() + theme_sca();

Run the code above in your browser using DataLab