1

我在同一张图中有一条线和一个条形图。但是,条形图位于折线图的前面。如何将线图发送到前面?

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)

谢谢

4

1 回答 1

0

使用:par(new=TRUE) plot(data, function, axes = FALSE, xlab = "", ylab = "")

于 2012-08-23T00:20:31.020 回答