# ------------------------------------------------------------------
# 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
#
# Version: 2.1
# Authors: H. Kocak, University of Miami and B. Koc, Stetson University
# References:
# https://www.r-project.org
# ------------------------------------------------------------------
par(ask=TRUE)
# Prepare for 2x2 plots, to be filled by rows
par(mfrow = c(2, 2))
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)
# Return to single plot
par(mfrow = c(1, 1))
curve(sin(x), -5, 5)