R 将线图置于条形图的前面

R 将线图置于条形图的前面,r,R,我在同一张图中画了一条直线和一条条形图。但是,条形图位于线形图的前面。如何将测线图发送到前端 h<-hist(loose_All, breaks="FD", plot=FALSE) xfit<-seq(min(loose_All),max(loose_All),length=100) x.norm<-rnorm(n=100000, mean=mapply("[", results[1], 1), sd=mapply("[", results[1], 2)) y

我在同一张图中画了一条直线和一条条形图。但是,条形图位于线形图的前面。如何将测线图发送到前端

h<-hist(loose_All, breaks="FD", plot=FALSE)
xfit<-seq(min(loose_All),max(loose_All),length=100)
x.norm<-rnorm(n=100000, mean=mapply("[", results[1], 1),
         sd=mapply("[", results[1], 2))
yfit<-dnorm(xfit,mean=mean(x.norm),sd=sd(x.norm))
yfit <- yfit*max(h$counts)/max(yfit)
plot(xfit*1.1, yfit*1.1, col="blue", lwd=2, type="l", xlab="Looseness",
 main="Normal pdf and histogram",)
plot(h, add=TRUE, col="grey",freq=TRUE)
h使用:
标准杆(新=真)
绘图(数据、功能、,
axes=FALSE,xlab=“”,ylab=“”)

更短:
行(数据,函数)