In this recipe, you will learn how to present more than one graph in a single image. Pairs plots are one example, which we saw in the last recipe, but here, you will learn how to include different types of graphs in each cell of a graph matrix.

Let's say we want to make a 2 x 3 matrix of graphs, made of two rows and three columns of graphs. We use the `par()`

command as follows:

par(mfrow=c(2,3)) plot(rnorm(100),col="blue",main="Plot No.1") plot(rnorm(100),col="blue",main="Plot No.2") plot(rnorm(100),col="green",main="Plot No.3") plot(rnorm(100),col="black",main="Plot No.4") plot(rnorm(100),col="green",main="Plot No.5") plot(rnorm(100),col="orange",main="Plot No.6")

The `par()`

command ...

Start Free Trial

No credit card required