Try adding to your ggplot
geom_hline(yintercept = 0, size = 4) # or whichever size needed
For x
-intercepts, use:
geom_vline(xintercept = ...)
質問
I have a line graph with some points with positive value, and others with negative value (I am plotting odds ratios). I would like to make the y=0 grid line appear darker or bolder so as to make the visuals more apparent. How can I do this with ggplot2?
As an extension of this, I would also like to ask this: is there a way I can make particular grid lines darker or bolder (say, y=5 or a vertical grid line x=-2)?
解決
Try adding to your ggplot
geom_hline(yintercept = 0, size = 4) # or whichever size needed
For x
-intercepts, use:
geom_vline(xintercept = ...)