Remove Plot Margins in ggplot2

后端 未结 1 1853
不思量自难忘°
不思量自难忘° 2020-12-08 19:47

I\'m trying to produce a png chart using ggplot2 and ggsave (with Cairo) in R. I\'m having an issue with customising the theme to remove margins.

Currently I\'m usin

相关标签:
1条回答
  • 2020-12-08 20:41

    According to the source code, you also need to set the labels to NULL,

    last_plot() + labs(x=NULL, y=NULL)
    

    alternatively, set unit(-0.5, "line") for the bottom and left margins.

    0 讨论(0)
提交回复
热议问题