2016-12-12 1 views
0

私はサイズ

h<-hist(df[,1], breaks=10, density=10, col="lightgray", xlab="Accuracy", main="Overall")  
xfit<-seq(min(df[,1]),max(df[,1]),length=40) 
yfit<-dnorm(xfit,mean=mean(df[,1]),sd=sd(df[,1])) 
yfit <- yfit*diff(h$mids[1:2])*length(df[,1]) 
lines(xfit, yfit, col="black", lwd=2) 

属する正規分布とのヒストグラムを生成するには、次のコードを使用し、私はそのようどのように私は、プロットのサイズを小さくすることができますプロットの全正規分布を見ることができますか? http://statmethods.netから

plot

+0

'あなたのコードをdf'せず、再現 –

+0

DFはない[1]ちょうど1000年の通常の分散番号がために(hist''に引数 'YLimプロパティ= Cの呼び出しで(0200)を'含める – maniA

+2

含まれてい例)。 – Joe

答えて

0
df <- data.frame(rnorm(1000), rnorm(1000)) 
h <- hist(df[,1], breaks=10, density=10, col="lightgray", xlab="Accuracy", main="Overall")  
xfit <- seq(min(df[,1]),max(df[,1]),length=40) 
yfit <- dnorm(xfit,mean=mean(df[,1]),sd=sd(df[,1])) 
yfit <- yfit*diff(h$mids[1:2])*length(df[,1]) 
par()$pin 
par(pin=c(2,2)) 
lines(xfit, yfit, col="black", lwd=2) 

マージンとグラフサイズ

あなたは以下のパラメータを使用して、余白のサイズを制御することができます。

option description 
mar numerical vector indicating margin size c(bottom, left, top, right) in lines. default = c(5, 4, 4, 2) + 0.1 
mai numerical vector indicating margin size c(bottom, left, top, right) in inches 
pin plot dimensions (width, height) in inches