Re: [R] histograms and for loops

From: vioravis <>
Date: Fri, 06 May 2011 10:58:12 -0700 (PDT)

This should work!!

for(i in 1:12){
xLabel <- paste("Graph",i)
plotTitle <- paste("Graph",i,".jpg")
print(hist(zNort1[,i], freq=FALSE, xlab=xLabel, col="blue", main="Standardized Residuals Histogram", ylim=c(0,1), xlim=c(-3.0,3.0)),axes = FALSE)
axis(1, col = "blue",col.axis = "blue")
axis(2, col= "red",col.axis = "red")
X1<-seq(-3.0, 3.0, by=.01)
lines(X1, dnorm(X1, zNortmean, zNortsd) , col="black")

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 06 May 2011 - 18:05:42 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 May 2011 - 18:20:05 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive