# FILE NAME: multiple_plots.R # With the par() command can set the multi plot environment. # mfcol = c(nr,nc) partitions the graphic window as a matrix of nr rows and nc columns, # the plots are then drawn in columns. # mfrow = c(nr,nc) partitions the graphic window as a matrix of nr rows and nc columns, # the plots are then drawn in rows. # You can get fancy partitions of the plotting window with layout() function # Huseyin Kocak, May 25, 2016. University of Miami par(ask=TRUE) par(mfrow = c(2, 2)) #prepare for 2x2 plots, to be filled by rows t = seq(0, 10, 0.2) plot(t, sin(t)) curve(sinh(x), -5, 5) curve(tan(x), n = 500, -5, 5) curve(round(x), n= 500, -5, 5) par(mfrow = c(1, 1)) #return to single plot curve(sin(x), -5, 5)