0% found this document useful (0 votes)
10 views2 pages

R Plot Customization Techniques

The document outlines the features of R for data visualization, focusing on plot customization, including points, lines, titles, colors, and margins. It also discusses arranging multiple plots, customizing axes, and adding text and legends. Finally, it explains how to save plots in different formats.

Uploaded by

bgstyf271
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

R Plot Customization Techniques

The document outlines the features of R for data visualization, focusing on plot customization, including points, lines, titles, colors, and margins. It also discusses arranging multiple plots, customizing axes, and adding text and legends. Finally, it explains how to save plots in different formats.

Uploaded by

bgstyf271
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

R Programming Seminar

Topic: Plot Customization, Plotting Regions and Margins

1. Introduction

R provides powerful tools for data visualization. Base R graphics allow customization of colors,
shapes, lines, text, margins, and plotting regions.

2. Plot Customization in R

2.1 Customizing Points

- pch: point shape (0–25)

- col: point color

- cex: point size

2.2 Customizing Lines

- lty: line type (1–6)

- lwd: line width

2.3 Titles and Labels

- main: main title

- xlab, ylab: axis labels

- sub: subtitle

2.4 Colors

- Named colors (e.g., "red")

- Hex codes

- Palettes: rainbow(), [Link](), [Link]()

3. Plotting Regions

3.1 Multiple Plots

Use par(mfrow=c(r,c)) to arrange plots in a grid.

3.2 [Link]()
Enables flexible division of the plotting window.

4. Margins in R

- mar: margins around individual plots

- oma: outer margins for multi-plot layouts

5. Axes Customization

- axes=FALSE removes default axes

- axis() adds custom axes

6. Adding Text, Lines, and Legends

- text(): add text inside plot

- abline(): add reference lines

- legend(): add legend

7. Saving Plots

Use png() or pdf() to save plots.

8. Summary

Plot customization includes control over points, lines, labels, margins, plotting regions, axes,
legends, and saving outputs.

You might also like