combine_gpars: Combine Graphical Parameters

Description Usage Arguments Details Author(s)

Description

Combine a list of graphical parameters.

Usage

1

Arguments

list

An R list (not a gpar list), each element of which is a gpar list). The first element is taken as the "base" parameters.

index

Integer index indicating how the parameters should be expanded.

Details

The idea is this; sometimes it makes sense to think of different regions of a tree, or different lines, words, etc having different graphical parameters, and we'd like to set them using the gpar() function. Something like 'list(base=gpar(col="black"), Asteraceae=gpar(col="yellow"))' and then have these expanded out to a single gpar object with the col element appropriately vectorised, so that the branches, tip labels, node labels, etc for Asteraceae will end up yellow while everything else remains black.

This should work for any number of parameters, so that if lwd is present in one list and not in the other, when everything gets vectorised out, lwd is going to be needed in both. That means that we need to look up what the appropriate default value of lwd is going to be. We do that by using get.gpar() (if this is used during a drawDetails method then this will behave most predictably, otherwise it will probably end up with the grid defaults).

Note that if no graphics window is open, this will open one.

The first element of the list is considered to be the base parameters.

This function does not do validation of parameters, or that we have even got gpar objects at this point. Also needing validation: each element is a scalar.

Author(s)

Rich FitzJohn


richfitz/forest documentation built on May 27, 2019, 8:17 a.m.