R ggplot, remove white margins in ggsave/ggplot

前端 未结 4 1111
孤街浪徒
孤街浪徒 2021-02-04 06:56

How can I remove the white margins in ggsave?

My question is exactly the same as Remove white space (i.e., margins) ggplot2 in R. However, the answer there isn\'t ideal

4条回答
  •  你的背包
    2021-02-04 07:25

    Found the answer from Remove Plot Margins in ggplot2

    theme(plot.margin=grid::unit(c(0,0,0,0), "mm"))
    

    does the job

提交回复
热议问题