Skip to contents

This internal function adds dashed vertical lines at specified treatment timepoints to a plot, along with text labels that display the corresponding x-axis values.

Usage

add_dashed_lines(p, treatment_timepoints, treatment_labels, y_pos)

Arguments

p

A ggplot object. The plot to which dashed lines and labels will be added.

treatment_timepoints

A numeric vector of timepoints where dashed lines should be drawn.

treatment_labels

A character vector of labels corresponding to each treatment timepoint. These labels are used for coloring the lines, but the x-axis coordinates are displayed as the labels.

y_pos

A numeric value specifying the y-axis position where the text labels should be placed.

Value

A ggplot object with added dashed lines and labels.