Remove Plot Margin in Base R



To remove the plot margin in base R between the axes and the points inside the plot, we can use xaxs and yaxs argument in plot function. Depending on the choices of the arguments xaxs and yaxs, the plot region in the respective direction is 4% larger than specified by these limits or exactly matches the "i" limits.

Example

x<-rnorm(10)
plot(x)

Output

Example

plot(x,xaxs="i",yaxs="i")

Output

Updated on: 2021-02-08T05:40:39+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements