r-如何使用ggplot调整垂直刻度



我已经用ggplot绘制了图,请参阅数字。数字上移了。如何降低它,使0从x轴开始,100在绘图框内?

这是与绘图相关的代码

ggplot(DDAvg,aes(x=date,y=as.numeric(DD)))+geom_point(aes(color="blue3"),show.legend = FALSE,size=3)+geom_line(aes(color="blue3"),show.legend=FALSE,linetype="longdash",size=1)+
geom_smooth(method="lm",aes(color="blue3"),show.legend = FALSE)+
labs(title="Refreeze Events")+
scale_y_discrete("Cooling Degree Days (DD)",limits=c(0,20,40,60,80,100))+
scale_colour_manual(values=c("blue3"))

您可以使用+ ylim(0, 100)更改y轴限制。

最新更新