The color choices used across all glex visualization functions can be
adjusted globally via options():
Details
glex.palette(
NULL) Diverging palette used to color continuous interaction effects inplot_twoway_effects()andplot_threeway_effects(). The defaultNULLuses a blue/red gradient built fromglex.colors_sign, matching the look of the Pythonshapandshapiqpackages. Set to the name of a diverging scico palette (e.g."vik","roma") to use that instead.glex.palette_discrete(
"Dark2") Discrete palette used to color categorical predictors in interaction plots. Accepts a vector of colors (used viaggplot2::scale_color_manual()), the string"okabe-ito"(the colorblind-safe Okabe-Ito palette viagrDevices::palette.colors()), the name of a scico palette, or the name of an RColorBrewer palette.glex.colors_sign(
c("#008BFB", "#FF0051")) Two colors for negative and positive contributions inglex_explain(), also used as the endpoints of the default continuous gradient. The defaults follow the blue/red convention familiar from the Pythonshapandshapiqpackages.glex.color_line(
"#194155") Color for main effect lines and columns drawn byautoplot()andplot_pdp().
Examples
# Use a scico palette for continuous effects instead of the default gradient
options(glex.palette = "roma")
# Restore the default shap-style gradient
options(glex.palette = NULL)
# Categorical predictors: Okabe-Ito, a scico/brewer palette, or custom colors
options(glex.palette_discrete = "okabe-ito")
options(glex.palette_discrete = "batlow")
options(glex.palette_discrete = c("#E69F00", "#56B4E9", "#009E73"))