I'm trying to change the y-axis range in my ggplot. The problem is that i've rescaled it before.
ggplot(DichteM, aes(UT, Mittelwert.von.Solidagoscale) )+
geom_point()+
ggtitle("Solidago")+
theme(plot.title = element_text(hjust = 0.5, size = 12))+
stat_smooth(method = "lm", formula = "y~x", se=FALSE, size = 0.1)+
xlim(c(0,15))+
scale_y_discrete(limits = c("r", "+", "1","2","3","4","5"))+
#ylim(c(2,5))+
ylab("Dichte Braun-Blanquet")+
xlab("Überflutungstage/Jahr")
If I try with ylim( c(2, 5)): it overwrites the scale_y_discrete() function. Ive also tried with scale_y_continuous(limits = c(2, 5)) but it doesnt work out.
here is my plot
dput
?