How can I make the ZERO gridline bold?
Asked
Active
Viewed 624 times
0
-
[See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with, including sample data and code. You said a bold gridline, but then show a box around that line; what exactly are you trying to get? This is why an attempt at code is helpful – camille May 13 '21 at 14:28
-
1If you just want one line to be bold, I recommend just using `geom_hline` or `geom_vline` and plot them before any other `geom_*` function. – Justin Landis May 13 '21 at 14:35
2 Answers
2
I'm not certain about what you want without a reproducible example, but an easy solution could be by simply using geom_hline(yintercept=0, color = "grey", size=2)
. Of course you can change the color or size.

Ben Bolker
- 211,554
- 25
- 370
- 453

Kim
- 80
- 10
1
As @JustinLandis says, something like
geom_hline(yintercept=0,lwd=3)
should work (adjust the value of lwd
to your liking; you can also specify this as size
).
Since ggplot
plots in order, put this specification before your geom_line()
and other stuff.

Ben Bolker
- 211,554
- 25
- 370
- 453