You can add a new variable (called e.g. stripe) to the data, which alternates based on the value of DOY. After that you can use that variable as the basis for filled, transparent rectangles.
I'm assuming that DOY is a sequence of integers with interval = 1, so we can assign on the basis of whether DOY is odd or even.
(Note: sample - not a great variable name as there's a function of that name).
library(dplyr)
library(ggplot2)
sample %>%
mutate(stripe = factor(ifelse(DOY %% 2 == 0, 1, 0))) %>%
ggplot(aes(DOY, Max)) +
geom_point() +
geom_rect(aes(xmax = DOY + 1,
xmin = DOY,
ymin = min(Max),
ymax = Inf,
fill = stripe), alpha = 0.4) +
scale_fill_manual(values = c("white", "grey50")) +
theme_bw() +
guides(fill = FALSE)
If you are a beginner and want to know more about R then do check out the R programming course.