ggplot2标题下划线与粗体输出:2020-12-29

2022-04-15  本文已影响0人  RashidinAbdu
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( underline('Hello Rashidin Abdugheni! ')))
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( underline('Hello Rashidin Abdugheni! ')))
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression(bold(underline('Hello Rashidin Abdugheni! '))))
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( italic('Hello Rashidin Abdugheni! ')))
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( underline('Hello Rashidin Abdugheni! ')))+theme(plot.title = element_text(hjust = 0.5))     # Center ggplot title
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( italic('Hello Rashidin Abdugheni! ')))+
    theme(plot.title = element_text(hjust = 1))       # Align title on right side
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( underline('Hello Rashidin Abdugheni! ')))+
    theme(plot.title = element_text(vjust = 3))       # Change vertical position
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( italic('Hello Rashidin Abdugheni! ')))+
    theme(plot.title = element_text(vjust = - 10))    # Change position downwards
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +
    ggtitle(expression( underline('Hello Rashidin Abdugheni! ')))+
    theme(plot.title = element_text(vjust = -153,hjust = 0.5))       # Change vertical position
image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +labs(title = "Hello Rashidin",tag = "Figure 1: This is a test note") +coord_cartesian(clip = "off") +theme(plot.title = element_text(hjust = 0.5),plot.margin = margin(t = 10, r = 10, b = 40, l = 10),plot.tag.position = c(0.2, -0.1))

image.png
DF<- data.frame(x = 1:10, y = 1:10)
ggplot(DF, aes(x = x, y = y)) + geom_point() +labs(title = "Hello Rashidin",tag = "Figure 1: This is a test note") +coord_cartesian(clip = "off") +theme(plot.title = element_text(hjust = 0.5),plot.margin = margin(t = 10, r = 10, b = 40, l = 10),plot.tag.position = c(0.5, -0.1))
image.png
上一篇下一篇

猜你喜欢

热点阅读