Remove grid, background color, and top and right borders from ggplot2

后端 未结 7 1529
生来不讨喜
生来不讨喜 2020-11-29 16:31

I would like to reproduce the plot immediately below by using ggplot2. I can come close, but cannot remove the top and right borders. Below I present several attempts usin

7条回答
  •  时光取名叫无心
    2020-11-29 16:59

    Here's an extremely simple answer

    yourPlot +
      theme(
        panel.border = element_blank(), 
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(), 
        axis.line = element_line(colour = "black")
        )
    

    It's that easy. Source: the end of this article

提交回复
热议问题