Sunday, August 5, 2012

How to put multiple plots in one overall graph in R

To put multiple plots in one overall graph use par function to separate the graph in (x,y) fields.
For example:


> par (mfrow=c(2,2))
> plot(sort(medalcount$Gold), col=6, lwd=1, type="o")
> plot(sort(medalcount$Silver), col=6, lwd=1, type="o")
> plot(sort(medalcount$Bronze), col=6, lwd=1, type="o")
> plot(sort(medalcount$Total), col=6, lwd=1, type="o")

gave me the following output:




No comments:

Post a Comment