ggplot(df1, aes(x= seg.mean)) +
geom_histogram(binwidth=.6, colour="black", fill="white")
geom_vline(aes(xintercept=mean(seg.mean, na.rm=T)),
color="red", linetype="dashed", size=0.5)
如何增加x轴的断点,例如x轴的范围从-5到5,间隔为0.5
答案 0 :(得分:2)
使用scale_x_continuous:+scale_x_continuous(breaks=seq(-5,5,by=0.5))