使用facet_multiple后rmarkdown中打印标题的字体大小

时间:2018-04-19 06:52:48

标签: r ggplot2 markdown r-markdown

我使用facet_multiple以2x2样式生成10页图。虽然绘图本身看起来很好,但绘图标题的字体大小非常小。 facet_multiple或当我去编织文档时会覆盖图形中的字体大小。

这是图表:

P <- Data_Backs %>% 
group_by(Player.Name, Period,Day_Week) %>% 
summarise(mean_M_Min=mean(M_Min)) %>%
ggplot(aes(x=Period,y=mean_M_Min,colour=Day_Week, group=Day_Week)) + 
geom_line(size=2)+
geom_hline(yintercept = 120, show.legend = T)+
ylim(0,200)+
guides(color = guide_legend(override.aes = list(size=5)))+
theme(legend.text=element_text(size=30),
    plot.title = element_text(size=50))

而且:

```{r cars, warning=FALSE, echo=FALSE, message=FALSE,  fig.height = 30, 
fig.width = 30, fig.align = "center", }
facet_multiple(plot = P, facets = "Player.Name", ncol = 2, nrow = 2)

其中会生成以下多个网格

enter image description here

由于字体大小

,情节标题几乎不易辨认

2 个答案:

答案 0 :(得分:0)

fig.heightfig.width英寸定义地块尺寸。我认为你需要让它们变小。从6x6开始并手动纠正它直到成功。

答案 1 :(得分:0)

尝试out.width = "100%"而不是fig.height = 30, fig.width = 30