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

par() की Settings

par आपके drawing area की settings बदलता है, draw करने से पहले paper size और pen style चुनने की तरह। आप, उदाहरण के लिए, एक page पर कई plots रख सकते हैं।

In this page:

  1. par() Settings
Syntax
r
old_par <- par(mfrow = c(rows, cols))
# draw plots here
par(old_par)

par() Settings

par() global graphical parameters set या query करता है जो बाद के plots को affect करते हैं, जैसे कई plots को एक grid में arrange करने के लिए mfrow = c(rows, cols), या margins adjust करने के लिए mar।

यह वह तरीका है जिससे आप एक single plot() call के अपने arguments से आगे overall plotting layout customize करते हैं। par() से की गई settings reset न होने तक बाकी session के लिए persist करती हैं।

Note: par(mfrow = c(2, 2)) अगले चार plots को same plotting window में एक 2x2 grid में arrange करता है।

उदाहरण: 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")
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. par(mfrow = c(2, 2)) बदलना और कभी इसे reset न करना, इसलिए बाद के plots small grid में रहते हैं।
  2. एक नया plot device खोलने से पहले par() set करना, इसलिए settings खो जाती हैं।
  3. mar से margins बहुत छोटी बनाना, जो axis labels और titles काट देता है।
🔒

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.