How can I remove the strange white margin around my .png (plotted with r, ggplot)?

后端 未结 1 1037
孤街浪徒
孤街浪徒 2021-01-11 09:46

I save plots with ggplot as .png. The background has to be black, but there is allways a small white margin (only top, down an left; not right).

How can I remove th

相关标签:
1条回答
  • 2021-01-11 10:18

    The line you are seeing is the default outline colour of the plot.background rectangle element. You can remove it by setting colour to NA in your theme() call:

    theme(plot.background=element_rect(fill="black", colour=NA))
    
    0 讨论(0)
提交回复
热议问题