Remove colored border around ggplot

前端 未结 1 783
孤街浪徒
孤街浪徒 2021-01-21 02:41

I am adding ggplots to viewports. Both ggplot and viewport has the same background colour. My problem is that I hav

1条回答
  •  北海茫月
    2021-01-21 03:24

    It's the argument colour = NA in theme(plot.backround = ... ) you are looking for.

    Pie_chart <- ggplot(df , aes(x = "", y = prop_1, fill = rank) ) +
      geom_bar(stat="identity", width=2) +
      coord_polar("y", start = 0) + 
      labs(x = NULL, y = NULL, fill = NULL, title = "") + 
      theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), legend.position="none")+
      theme(plot.margin = unit(c(0.0, 0.0, 0.0, 0.0), "cm"),
            plot.background = element_rect(fill = "blue", 
                                           colour = NA), # here it is
            panel.background = element_rect(fill = "blue"))
    

    ...

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