I first used geom_line
, and it returns the output that I want. But when using geom_smooth
with curvilinear formula, each line then started from different points which make comparison between line harder. How can I fix this, so all fitted lines start from the bottom of the Y-axis?
Code:
ggplot(data = induction,
mapping = aes(x = time_min, y = A_state, color = treatment_p, shape = treatment_p))+
geom_smooth(method = "lm", formula = y ~ poly(x, 2))+
theme_classic() +
labs(x = "a" , y = "b%")+
theme(panel.border = element_rect(colour = "black", fill = NA, size = 2),
legend.position = "none" )+
geom_hline(yintercept = 90, linetype = "dashed", color = "black", size = 1.5)+
geom_hline(yintercept = 50, linetype = "dashed", color = "black", size = 1.5)+
scale_y_continuous(breaks = c(0,25,50,75,90,100))