Add x and y axis to all facet_wrap

前端 未结 5 1955
离开以前
离开以前 2020-12-01 06:11

It is often desirable to minimize ink in a plot. I have a faceted plot (facet_wrap) and would like to remove as much ink as possible yet maintain readability.

5条回答
  •  孤独总比滥情好
    2020-12-01 06:45

    easiest way would be to add segments in each plot panel,

    ggplot(mtcars, aes(mpg, hp)) + 
      geom_point() + 
      facet_wrap(~carb) +
      theme_minimal() +
      annotate("segment", x=-Inf, xend=Inf, y=-Inf, yend=-Inf)+
      annotate("segment", x=-Inf, xend=-Inf, y=-Inf, yend=Inf)
    

提交回复
热议问题