[R] Graphical Parameters

Jim Lemon jim at bitwrit.com.au
Mon Aug 17 13:42:32 CEST 2009


mohsin ali wrote:
> Hi Sir
>
>  
>
> How can I change plot size, figure size and device size? The examples availble for par() function are not very helpful. Would you please give a very simple example?
>
>   
Hi Mohsin,
The device size is determined by the function that starts it. For 
example, the default "graphics window" is 7x7 inches (17.78x17.78 cm). 
To find out what the device size is:

par("din") # in inches

The figure size is the device size less the "outer margin". This is 
often the same as the device size, unless you explicitly set the outer 
margins:

par(oma=...) # in lines of text
OR
par(omi=...) # in inches

To find out what the figure size is:

par("fin") # in inches

The plot size is the figure size less the margin. To find out what it is:

par("pin") # in inches
OR
par("usr") # in user units

So you could set up the three like this:

x11(width=9,height=6)
par(oma=c(1,1,1,1)) # allow space for one line of text on each side
par(mar=c(0,4,3,2)) # allow this much space for lines of text inside the 
figure

Jim




More information about the R-help mailing list