如何使用ggplot调整垂直刻度

我用ggplot绘制了图 figure。该数字已上移。如何降低它,使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"))
liuchun227728 回答:如何使用ggplot调整垂直刻度

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

本文链接:https://www.f2er.com/3155412.html

大家都在问