par() Settings
In this page:
par() Settings
par() sets or queries global graphical parameters that affect subsequent plots, such as mfrow = c(rows, cols) to arrange multiple plots in a grid, or mar to adjust margins. It's how you customize the overall plotting layout beyond a single plot() call's own arguments. Settings made with par() persist for the rest of the session unless reset.
Note: par(mfrow = c(2, 2)) arranges the next four plots into a 2x2 grid in the same plotting window.
Example: par() Settings
cat("par(mfrow = c(2, 2)) would arrange the next 4 plots into a 2x2 grid\n")
cat("par(mar = c(4, 4, 2, 1)) would adjust the plot margins (bottom, left, top, right)\n")
Login to try C/C++/Java/PHP code in the editor
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: