gg_add_generation_bands: Add bands of transparent colors to denote generations on...

View source: R/gg_add_generation_bands.R

gg_add_generation_bandsR Documentation

Add bands of transparent colors to denote generations on plots of ancestor-match matrices

Description

Pass it the original ggplot, and this will return it, with the bands added

Usage

gg_add_generation_bands(
  g,
  L,
  alpha = 0.2,
  colors = c("red", "orange", "yellow", "green", "blue"),
  add_impossibles = FALSE
)

Arguments

g

the original ggplot

L

the number of rows (or columns) in the ancestor-match matrices

alpha

the transparency to use for these color-bands

colors

the colors in order of self, parent, grandparent, etc. By default it is just rainbow order starting from red.

add_impossibles

pass TRUE if you want to blot out the cells that are not possible because they conflict with the sex of the individuals. You set the fill of the impossibles with a scale_fill_manual() in the main ggplot call. i.e.,

scale_fill_manual(values = c(`FALSE` = NA, Impossible = "white", `TRUE` = "black"))

eriqande/CKMRpop documentation built on Jan. 25, 2024, 2:10 p.m.