theme_certara: A ggplot2 theme for Certara CSC-iDD

View source: R/theme_certara.R

theme_certaraR Documentation

A ggplot2 theme for Certara CSC-iDD

Description

A ggplot2 theme for Certara CSC-iDD

Usage

theme_certara(
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  grid = c("none", "horizontal", "both")
)

theme_certara_grid(
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22
)

theme_certara_hgrid(
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22
)

scale_colour_certara(...)

scale_color_certara(...)

scale_fill_certara(...)

scale_colour_certara_c(..., guide = "colourbar")

scale_fill_certara_c(..., guide = "colourbar")

Arguments

base_size

base font size, given in pts.

base_family

base font family

base_line_size

base size for line elements

base_rect_size

base size for rect elements

grid

Which grid lines should appear? Horizontal only, both horizontal and vertical, or none (default).

...

Other arguments passed on to discrete_scale() or continuous_scale().

guide

A function used to create a guide or its name. See guides() for more information.

Details

There are 3 variants of the theme: no grid (theme_certara()), full grid (theme_certara_grid()), and horizontal grid lines only (theme_certara_hgrid()).

Value

An object of class theme().

Examples


## Not run: 
library(ggplot2)

set.seed(123)
x <- rnorm(100) + 3
g <- rep(0:5, len=100)
y <- exp(rnorm(100, 0.33*x + 0.2*g, 0.1))
g <- factor(g, labels=do.call(paste0, rep(list(letters[1:6]), 3)))

theme_set(theme_certara())
scale_colour_discrete <- function(...) scale_color_certara(...)
scale_fill_discrete <- function(...) scale_fill_certara(...)

gl <- guide_legend("Legend", title.position="top")
p <- ggplot(data.frame(x, y, g), aes(x=x, y=y, color=g, shape=g, linetype=g, fill=g)) +
    geom_point() +
    geom_smooth(method="lm", se=T) +
    labs(title="Random Data", subtitle="test-test") +
    guides(colour=gl, fill=gl, shape=gl, linetype=gl)
p

p + theme_certara_grid()
p + scale_y_continuous(position="right")

p + facet_wrap(~ g)
p + scale_y_log10() + annotation_logticks(sides="l")
p + scale_y_log10() + annotation_logticks(sides="l") + theme_certara_grid()

v <- ggplot(faithfuld) + geom_tile(aes(waiting, eruptions, fill=density))
v + scale_fill_certara_c()

p <- function(n=8) {
    dat <- data.frame(x=1:n)
    ggplot(dat) + geom_col(aes(x=x, y=1, fill=factor(x)), color=NA, show.legend=F)
}
p(8) + scale_fill_certara()
p(8) + scale_fill_certara(start=11)
p(4) + scale_fill_certara(select=c(14, 19, 1, 5))
p(8) + scale_fill_certara(start=9, discard=4)
p(8) + scale_fill_certara(permute=c(2, 4, 1))
p(8) + scale_fill_certara(permute=c(2, 4, 1), discard=3)
p(30) + scale_fill_certara()


## End(Not run)

certara/ggcertara documentation built on Feb. 28, 2024, 5:01 a.m.