Please forgive my ignorance if this is a simple question, but I canโt understand how to emphasize any part of the title of the plot. I am using ggplot2 .
The best I could find was to annotate (a โsegmentโ) by hand , and I created a toy story to illustrate its method.
df <- data.frame(x = 1:10, y = 1:10) rngx <- 0.5 * range(df$x)[2] # store mid-point of plot based on x-axis value rngy <- 0.5 * range(df$y)[2] # stores mid-point of y-axis for use in ggplot ggplot(df, aes(x = x, y = y)) + geom_point() + ggtitle("Oh how I wish for ..." ) + ggplot2::annotate("text", x = rngx, y = max(df$y) + 1, label = "underlining!", color = "red") + # create underline: ggplot2::annotate("segment", x = rngx-0.8, xend = rngx + 0.8, y= 10.1, yend=10.1)

uses bquote (underline () with R base
refers to the lines above and below the nodes in the graph
uses plotmath and offers a workaround, but that didn't help
r plot ggplot2 underline plotmath
lawyeR
source share