Add dashed lines for treatment timepoints to a plot
add_dashed_lines.Rd
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.
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.