Colour palettes | R Documentation |
These palettes can be passed to the plotting functions to change the model colours.
By passing in the all.model.names
it is possible to ensure that the model colours are consistent when plotting subsets of the full model set.
You can even write your own function.
default.model.colours(
selected.model.names,
all.model.names = selected.model.names
)
colourblind.model.colours(
selected.model.names,
all.model.names = selected.model.names
)
rainbow.model.colours(
selected.model.names,
all.model.names = selected.model.names
)
groovy.model.colours(
selected.model.names,
all.model.names = selected.model.names,
axis = "A"
)
selected.model.names |
A character vector of the subset of model names you want to plot. |
all.model.names |
A character vector of the all model names |
A named vector of colours, the same length and names as the models to be plotted.
all.model.names <- c("a","b","c","d")
# If you don't supply all.model.names, the colours for the models will not be consistent
default.model.colours(selected.model.names=all.model.names[1:2])
default.model.colours(selected.model.names=all.model.names[3:4])
# Colours for the models should not change when subsetting
# Supply all.model.names to make consistent
default.model.colours(selected.model.names=all.model.names, all.model.names=all.model.names)
default.model.colours(selected.model.names=all.model.names[1:2], all.model.names=all.model.names)
default.model.colours(selected.model.names=all.model.names[3:4], all.model.names=all.model.names)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.