在R中使用geom_label作为我的(gg)图时,我注意到文本上面的空间比下面的空间要大。如何将文本对齐到标签框的中间?
x <- data.frame(x = c("Being not", "Creative"), y = c(0.5, 1), text = c(543,12345))
g <- ggplot(data=x, aes(x, y)) + geom_bar(stat = 'identity', fill=c("red4","cornflowerblue"))
g + geom_label(aes(y = -Inf, label = text), vjust = -2)
# increasing `label.padding` here to exaggerate the white space
g + geom_label(aes(y = -Inf, label = text), vjust = -2, label.padding = unit(1, "lines")