Lov*_*yVV 5 html markdown r legend figure
我在 markdown 文件中生成了一些图表,但图表在 html 文件中看起来不正确。
在 RStudio 中,它运行良好,如下所示:
但是在markdown html文件中,右侧的图例框被截断了:
我尝试调整fig.width, fig.align, fig.show='asis', fig.crop。他们要么没有做任何改变,要么只是让整个图形看起来更窄,图例框仍然不完整。
fig.width
fig.align
fig.show='asis'
fig.crop
有没有办法让它在markdown html文件中看起来正常?
小智 2
我在 Rmarkdown html 报告中也遇到了这个问题,我通过更改 ggplot2 中的绘图边距来解决它:theme(plot.margin=unit(c(1,2,1,1),"cm"))。第二个“单位”编号从 1 增加到 2,以允许右侧的图例。我在这里找到了这个答案:ggplot2:从纵横比中排除图例
归档时间:
10 年 前
查看次数:
2865 次
最近记录:
5 年,7 月 前