How can I suppress the vertical gridlines in a ggplot2 plot while retaining the x-axis labels?

前端 未结 5 1083
轮回少年
轮回少年 2021-02-19 23:54

This is a follow-on from this question, in which I was trying to suppress the vertical gridlines.

The solution, as provided by learnr, was to add scale_x_continuous(brea

5条回答
  •  北荒
    北荒 (楼主)
    2021-02-20 00:04

    For people looking this up in 2020, I have found a solution in the form of the removeGrid function from the ggExtra library here rdrr.io > removeGrid

    I have tested it to be working with ggplot2 version 3.3.0 and ggExtra version 0.9, giving me axis ticks without the gridlines.

提交回复
热议问题