8.3 Multiple figures side-by-side

You can place multiple figures side-by-side using the fig.hold='hold' along with the out.width option. In the example below, we have set out.width="50%":

par(mar = c(4, 4, 0.1, 0.1))
plot(cars)
plot(mpg ~ hp, data = mtcars, pch = 19)
Side-by-side figures.Side-by-side figures.

FIGURE 8.1: Side-by-side figures.

This simple approach works for both PDF and HTML output.