I'm attempting to recreate the following plot styling in R:
The data doesn't need to map onto the gradient in any meaningful way (though I guess technically it somewhat maps on to the categorical steps of the x-axis, with the colour gradually changing as the date/month changes).
I've tried scale_colour_gradient() and scale_fill_gradient(), but I'm not having any luck. Any guidance on how I could achieve something similar would be appreciated!
Sample data:
views <- tribble(
~month, ~views,
"Jan", 374,
"Feb", 500,
"Mar", 416,
"Apr", 603,
"May", 389,
"Jun", 510) %>%
transform(month = factor(month, levels=c("Jan","Feb","Mar","Apr","May","Jun")))
views %>%
ggplot(., aes(x = month, y = views, group=1)) +
geom_line(color="red") +
scale_y_continuous(breaks=seq(0, 1000, by = 200),
limits = c(0, 1000))