If adding a single label, it is generally most straightforward to use annotate()
since geom_text()
will repeat the label based on the length of the plotting dataset.
From the documentation of geom_text()
:
geom_text
andgeom_label
both add a label for each row in the data, even if coordinates x, y are set to single values in the call togeom_label
orgeom_text
. To add labels at specified points useannotate()
withannotate(geom = "text", ...)
orannotate(geom = "label", ...)
So you could do
annotate(geom = "text", label = "Alpha[qq]%~~%10^10", x = 1.5, y = -3,
parse = TRUE, colour = "black", size = 7)
Alternatively you could pass geom_text()
an empty data.frame and use inherit.aes = FALSE
:
geom_text(data = data.frame(), aes(label = "Alpha[qq]%~~%10^10", x = 1.5, y = -3),
parse = TRUE, colour = "black", size = 7, inherit.aes = FALSE)
In terms of adding your units, I wasn't sure I understood exactly. Do you want something like
label = "Alpha[qq]%~~%10^10~units"
?