-1

How can I use bold, italic and underline in a graphic title or axis in ggplot2?

ramgouveia
  • 5
  • 1
  • 4

1 Answers1

1

Here is the trial with the links I shared in comment - Not sure what you want to achieve though

data <- data.frame(x = runif(10), y = runif(10))

library(ggplot2)
ggplot() +
  geom_point(data, mapping = aes(x, y)) +
  ggtitle(expression(atop(paste(bold("Bold "), italic(" italic"),
    underline(" underline"), 
    underline(bold(" underline can go with bold")), 
    underline(italic(" or italic"))),
    paste(bolditalic(" - and italic & bold together"),
    underline(bolditalic(" - and all together"))))))

Created on 2021-05-12 by the reprex package (v2.0.0)

Sinh Nguyen
  • 4,277
  • 3
  • 18
  • 26