plot_csvy_control: Control settings for plot.csvy

View source: R/plot.csvy.R

plot_csvy_controlR Documentation

Control settings for plot.csvy

Description

Creates a list of graphical options to customize plots generated by plot.csvy. This includes labels, text sizes, colors, shapes, themes, and other display features.

Usage

plot_csvy_control(
  x1lab = NULL,
  x1_labels = TRUE,
  x2lab = NULL,
  x2_labels = TRUE,
  x3lab = NULL,
  x3_labels = TRUE,
  x4_vals = NULL,
  x4_labels = NULL,
  ynm = NULL,
  ci = TRUE,
  legend = TRUE,
  ylab = TRUE,
  x1size = 3.8,
  x2size = 3.8,
  constrained_color = "cornflowerblue",
  unconstrained_color = "#A3C99A",
  constrained_shape = 16,
  unconstrained_shape = 18,
  ribbon_fill = "lightblue",
  line_color = "black",
  base_theme = ggplot2::theme_minimal(),
  subtitle.size = 12,
  angle = 0,
  hjust = 0.1
)

Arguments

x1lab

Character. Label for the first covariate (x-axis). Default is NULL.

x1_labels

Logical or Character vector. Custom tick labels for the first covariate. Default is TRUE. If it is TRUE, tick labels will be created; if it is a character vector, then this vector will be used as the tick labels.

x2lab

Character. Label for the second covariate (x-axis). Default is NULL.

x2_labels

Logical or Character vector. Custom tick labels for the second covariate. Default is TRUE. Default is TRUE. If it is TRUE, tick labels will be created; if it is a character vector, then this vector will be used as the tick labels.

x3lab

Character. Label for the third covariate, if used (for subtitles or grouping). Default is NULL.

x3_labels

Logical or Character vector. Custom labels for the third covariate. Default is TRUE. If it is TRUE, labels will be created; if it is a character vector, then this vector will be used as the labels.

x4_vals

Character vector. For models with more than three predictors, specifies the category to use for each additional predictor. Defaults to NULL, using the mode of each.

x4_labels

Character vector. Custom labels for the fourth covariate. Default is NULL.

ynm

Character. Label for the response. Default is NULL.

ci

Logical. If TRUE, confidence bands are displayed. Defaults to TRUE.

legend

Logical. If TRUE, legend for constrained fit or unconstrained fit will be shown. Defaults to TRUE.

ylab

Logical. If TRUE, the response name will be shown on the y-axis. Defaults to TRUE.

x1size

Numeric. Font size for annotation labels on the x1 axis. Default is 3.8.

x2size

Numeric. Font size for annotation labels on the x2 axis. Default is 3.8.

constrained_color

Character. Color used to display fitted values and intervals from the constrained model. Default is "cornflowerblue".

unconstrained_color

Character. Color used to display fitted values and intervals from the unconstrained model. Default is "#A3C99A".

constrained_shape

Integer. Shape code (used by ggplot2) for points corresponding to constrained fits. Default is 16 (solid circle).

unconstrained_shape

Integer. Shape code for points from unconstrained fits. Default is 18 (solid diamond).

ribbon_fill

Character. Fill color for the confidence ribbon around the fitted lines. Default is "lightblue".

line_color

Character. Color of the lines connecting the fitted values. Default is "black".

base_theme

A ggplot2 theme object used as the base plot theme. Default is ggplot2::theme_minimal().

subtitle.size

Numeric. Font size for the subtitle text in the plot. Default is 12.

angle

Numeric. Angle (in degrees) to rotate x-axis labels (typically for x1). Default is 0.

hjust

Numeric. Horizontal justification for rotated x-axis labels. Default is .1 (right-aligned).

Value

A named list of graphical control parameters to be passed to the control argument in plot.csvy.

Examples

plot_csvy_control(
  x1lab = "Age Group", 
  x2lab = "Region", 
  constrained_color = "cornflowerblue", 
  unconstrained_color = "gray80",
  x1size = 4.5
)


csurvey documentation built on June 8, 2025, 12:41 p.m.