# How to create a plot in base R without margins?

R ProgrammingServer Side ProgrammingProgramming

#### Artificial Intelligence : The Future Of Programming

15 Lectures 54 mins

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

To create a plot without margins, we first need to define that margin in a way that the plot created after that will not have margins and this can be done by using par function. We would need to pass mar function within par function as par(mar=c(0,0,0,0)).

## Example

Live Demo

par(mar=c(0,0,0,0))
plot(1:10)

## Example

Live Demo

barplot(1:10)

## Output

Updated on 07-Dec-2020 05:02:02