相关疑难解决方法(0)

ggplot2多行标题,不同的缩进

我正在为出版物生成图表,我希望能够在ggplot本身标注图形的面板(而不是导出到出版商等),以便它们在最终文档中整齐地整合在一起.我打算通过在标题中添加一个字母("A")来尝试这样做,但我希望我的标题居中,我想要左上角的字母.

# base graph:

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species, shape = Species))+
  geom_jitter(size = 6.5)+
  ggtitle("A \n \n The Actual Long, Normal Title of Titliness")+
  theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 30),
        axis.ticks = element_blank(),
        legend.text = element_text(size = 25),
        axis.title = element_text(size = 25, face = "bold"),
        axis.text = element_text(size = 25, vjust = 0.05),
        legend.position = "bottom")
Run Code Online (Sandbox Code Playgroud)

哦,不! 它们都以图形为中心

现在,如果我愿意通过手工间隔每个标题"伪造它",我可以让它起作用,但这似乎是时间密集和粗糙的.

# sloppy solution
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color …
Run Code Online (Sandbox Code Playgroud)

r indentation figures ggplot2

6
推荐指数
2
解决办法
2940
查看次数

标签 统计

figures ×1

ggplot2 ×1

indentation ×1

r ×1