Когда я строю два графика (функцию и график), у меня возникает проблема с осями.
Я уже пытался указать оси = FALSE.Хотя это не сработало ...
Вот мой код:
n = 64
p = 0.5
tailleEchantillon<-1000
m = n * p
sigma = sqrt(n * p * (1 - p))
borne_sup = m+7*sigma
borne_inf = m-7*sigma
x = 0:n
echantillon = rbinom(tailleEchantillon,n,p)
tabEffectifs = NULL
for (i in x) {tabEffectifs = c(tabEffectifs,length(echantillon[echantillon == i]))}
print("Tableau des effectifs")
print(table(echantillon,deparse.level=2))
texteLegende1<-bquote(p == .(p))
texteTitre1 = ""
barplot(tabEffectifs,las=1,names.arg=x,col="blue",ylim=c(0,(tailleEchantillon/4)),legend.text=texteLegende1,main=texteTitre1,xlab="k",ylab="Effectifs",cex.main=1)
tabFrequences = tabEffectifs/tailleEchantillon
plot(function(x) dnorm(x, m, sigma), borne_inf, borne_sup, legend.text="Courbe loi normale", ylim=c(0,0.10), xlab="x", ylab="prob")
par(new = T)
barplot(tabFrequences,las=1,names.arg=x, col="red", ylim=c(0,0.10),legend.text=texteLegende2,main=texteTitre2,xlab="k",ylab="Densites",cex.main=1)
Кто-нибудь знает, как мне избежать этой проблемы с наложением осей?Спасибо.