Description Usage Arguments Details Author(s)
Combine a list of graphical parameters.
1 | combine_gpars(list, index)
|
list |
An R list (not a |
index |
Integer index indicating how the parameters should be expanded. |
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.
Rich FitzJohn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.