Author Login
Post Reply
Hi Everyone,
I want to make 3 lines on the same graph (not as subplots, all in the same
window, one on top of each other) and I want them to be quantile-quantile
plots (qqplot). Essentially, I am looking for the equivalent of Matlab's
"hold on" command to use with qqplot. I know I can use 'points' or 'lines',
but these do not give me a qqplot (only appear to work as scatter plots). I
found the syntax 'par(new=TRUE)' but that only seems to work for two lines,
not for three.
My script currently looks like:
qqplot(nq.n5,tq.n5,col="red",xlab="Normal Distribution Quantiles",ylab="t
Distribution Quantiles",main="Quantile-Quantile Plot of Normal vs
t-Distribution for Various Sample Sizes",pch=20)
par(new=TRUE)
qqplot(nq.n50,tq.n50,col="blue",xlab="",ylab="",pch=20).
par(new=TRUE)
qqplot(nq.n500,tq.n500,col="green",xlab="",ylab="",pch=20)
legend("topleft",c("n=5","n=50","n=500"),fill=c("red","blue","green"))
I realize that this only plots the first and the third qqplot because by
doing par(new=TRUE) again, it gets rid of the middle one. I don't know how
to get around this and get all 3 lines on the same plot.
Can anyone please help me with this syntax?
Thank you very much for your time and advice!
Cheers,
Melissa
--
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.