← Back to R Course | Chapter 10: Data Visualization | Lesson 6 of 7

par() Settings

In this page:

  1. par() Settings

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

markup
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")
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.