As the number of data points grows, the splines become invisible against the back drop. How can I darken the colour of the splines? Or another method to correct this visibility issue?
library(dplyr)
library(ggplot2)
library(mgcv)
# Summer
Summer <- mgcv::gamSim(eg=5,n=10000,dist="normal",scale=0.6,verbose=TRUE) %>%
mutate(x = x2 * 20) %>%
rename("Season" = x0) %>%
mutate(Season = ifelse(Season == "1", "Summer", Season)) %>%
filter(.,Season == "Summer") %>%
select(y, x, Season)
# Winter
Winter <- mgcv::gamSim(eg=5,n=10000,dist="normal",scale=1.0,verbose=TRUE) %>%
mutate(x = x1 * 20) %>%
rename("Season" = x0) %>%
mutate(Season = ifelse(Season == "3", "Winter", Season)) %>%
filter(.,Season == "Winter") %>%
select(y, x, Season)
# Bind
DF <- rbind(Summer, Winter)
# Plot
Plot <- DF %>%
ggplot(., aes(x = x, y = y, colour = Season)) +
geom_jitter() +
geom_point(shape=21, alpha = 0.5, size=0.05) +
geom_smooth(method = "gam", formula = y ~ s(x, bs = "cs", k = 10), lwd = 1.6)
Plot

