[R] graphical parameters: margins

Ricardo Rodríguez - Your XEN ICT Team webmaster at xen.net
Tue Jan 2 23:37:45 CET 2007

Ricardo Rodríguez
Your XEN ICT Team

>>> Gavin Simpson<gavin.simpson at ucl.ac.uk> 2/1/2007 17:44 >>>

>Either of these two gives you the answer

> help.search("graphical parameters")
> RSiteSearch("graphical parameters margin")

>more specifically, read ?par and in particular, the entry for parameter
>'mar' and it's relatives.

>You might also need to add the axis label separately from the figure:

>opar <- par(mar = c(5,7,4,2) +0.1)
>plot(1:10, ann = FALSE) # or plot(1:10, ylab = "")
>mtext("label", side = 2, line = 6)

>1) opar <- par(mar = c(5,7,4,2) +0.1) creates 7.1 lines on the left of
>the plot and saves defaults
>2) mtext("label", side = 2, line = 6) displays the axis label on line 6
>to push it away from the plot axis. Repeat for other sides...
>3) par(opar) resets to the defaults.


Thanks Gavin,

I frequently reach the help page or any other document concerning the doubt, but at least for me it is by no means easy to correctly interpret their contents without the help of more experienced people. I do hope  I will catch up ASAP!



More information about the R-help mailing list