This vignette shows how the plots created by the sjp.* and plot_model() functions of the sjPlot package can be customized.
The examples refer to sjp.grpfrq(), but most arguments are similar across all plotting function of the sjPlot package.
The base function to globally change theme option for all sjp-function is set_theme(). Except for geom-colors and geom-sizes, all theme-options can be set via this function. This new theme will be applied to all following plots created with the sjPlot package.
There are various arguments to change colors, sizes, angles etc. of labels. Following example show changes to colors, sizes, angles, geom-outlines and theme.
# load libraries
library(sjPlot) # for plotting
library(sjmisc) # for sample data
library(ggplot2) # to access ggplot-themes
# load sample data set
data(efc)
set_theme(
geom.outline.color = "antiquewhite4",
geom.outline.size = 1,
geom.label.size = 2,
geom.label.color = "grey50",
title.color = "red",
title.size = 1.5,
axis.angle.x = 45,
axis.textcolor = "blue",
base = theme_bw()
)
sjp.grpfrq(
efc$e42dep,
efc$e16sex,
title = NULL,
geom.colors = c("cadetblue", "coral"),