2
我正在尝试缩小我的长轴标签之间的间距。我基地R图形我应该使用lheight
,但似乎没有影响ggplot。是否有一个ggplot等价物?ggplot中文本的线高度间距
玩具例子来说明这个问题:
library("tidyverse")
df0 <- mtcars %>%
rownames_to_column("car") %>%
mutate(car = str_wrap(car, width = 10))
ggplot(data = df0, aes(x = car, y = mpg)) +
geom_bar(stat = "identity") +
coord_flip()
# has no effect
par(lheight = 0.5)
ggplot(data = df0, aes(x = car, y = mpg)) +
geom_bar(stat = "identity") +
coord_flip()
参见'ggsave','png' /'jpg'和/或与'主题指定文本的大小(axis.text = element_text(大小= ..)' – Jaap
@ ProcrastinatusMaximus据我所知,这会减少文本的大小(以及行间距),而不仅仅是行之间的空间大小......这就是我所追求的 – gjabel
如果我们在“避免重叠“,我们可以左对齐多个行名称,并右对齐单行名称? – zx8754