Adjust text position with vjust
option (theme in p2
is what you need).
library(ggplot2)
p1 <- qplot(rownames(head(mtcars)), 1) +
ggtitle("vjust = 0") +
theme(axis.text.x = element_text(angle = 90, vjust = 0))
p2 <- qplot(rownames(head(mtcars)), 1) +
ggtitle("vjust = 0.3") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.3))
gridExtra::grid.arrange(p1, p2, ncol = 2)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.