formatPlotColors: format a NicePlots color list

View source: R/np_options_processing.R

formatPlotColorsR Documentation

format a NicePlots color list

Description

To simplify code and user options, any color option not set by the user is added to the list and set to the default value.

Usage

formatPlotColors(plotColors, theme = NA)

Arguments

plotColors

list; a named list of vectors of colors that set the color options for all NicePlot functions. Names left unspecified will be added and set to default values automatically.

theme

list; A NicePlots plotColor list from a theme.

Details

The NicePlots plotColors object is a list of named color values/vectors. The options NicePlots colors include bg (background color), marginBg (color of area surrounding the plot), guides (guide lines for major tick-marks), minorGuides (guide lines for minor tick-marks) lines (lines for box/bar plots etc.), points (plotting data points), fill (fill for box/bar plots etc.), axis (axis colors), majorTick (major tick-mark color), minorTick (minor tick-mark color), labels (label colors), subgroupLabels (subgroup label colors), rectCol (inner quartile range box used in niceVio), and medianMarkerCol (the median value marker used in niceVio). Any option not set be the user will be added to the list and set to the default in order to insure compatibility with downstream NicePlot functions. If a theme is given, any option not set by the user will be set by the theme.

Value

a formated NicePlots color list.

Examples

myCols<-list(bg="lightgrey",fill=c("red","green","blue"),lines="darkgrey")
#\donttest{myCols<-formatPlotColors(myCols)}
print(myCols)

ZachHunter/NicePlots.R documentation built on Sept. 23, 2023, 4:04 a.m.