View source: R/connected_scatterplot.R
adorn_annotation | R Documentation |
This internal function adds a custom text annotation to a ggplot object, positioning it at a specified proportion of the plot's x and y axis ranges. The default annotation is used to indicate epidemic control.
adorn_annotation(
p,
annotation_label = "<-- Epidemic control",
annotation_proportion = 0.9
)
p |
A ggplot2 plot object to which the annotation will be added. |
annotation_label |
A character string specifying the text to annotate the plot with. The default value is "<– Epidemic control". |
annotation_proportion |
A numeric value between 0 and 1 indicating the position of the annotation relative to the axis ranges. Default is 0.9, placing the annotation close to the top-right of the plot. |
This function calculates the annotation position based on the specified proportion of the plot's axis limits. The annotation is angled at 45 degrees to provide visual emphasis, typically used to indicate a threshold or a notable point in the data.
The original ggplot2 plot object with the annotation added.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.