Multiple figure environment



next up previous contents
Next: Device drivers Up: Graphics parameters list Previous: Figure Margins

Multiple figure environment

S allows you to create an array of figures on a single page. Each figure has its own margins, and the array of figures is optionally surrounded by an outer margin as shown in Figure 11.

  
Figure 11: Page layout in multiple figure mode

The graphical parameters relating to multiple figures are as follows:


mfcol=c(3,2)
mfrow=c(2,4)

Set the size of multiple figure array. The first value is the number of rows; the second is the number of columns. The only difference between these two parameters is that setting mfcol causes figures to be filled by column; mfrow fills by rows. the arrangement in Figure 11 would have been creatd by setting mfrow=c(3,2); the figure shows the page after four plots have been drawn.


mfg=c(2,2,3,2)

Position of current figure in a multiple figure environment. The first two numbers are the row and column of the current figure; the last two are the numnber of rows and columns in the multiple figure array. Set this parameter to jump between figures in the array. You can even use differnt values for the last two numers that the true values for unequally-sized figures on teh same page.


fig=c(4,9,1,4)/10

Position of the current figure on the page. Values are the positions of the left, right, bottom and top edges respectively, as a percentage of the page measured from the bottom left corner. The example value would be for a figure in the bottom right of the page. Set this parameter for arbitrary positioning of figures within a page.


oma=c(2,0,3,0)
omi=c(0,0,0.8,0)

Sizes of outer margins. Like mar and mai, the first measures in text lines and the second in inches, starting with the bottom margin and working clockwise.


Outer margins are particularly useful for page-wise titles, etc. Text can be added to the outer margins with the mtext() function with argument outer=T. There are no outer margins by default, however, so you must create them explicitly using oma or omi.



Erik Moledor
Tue Jan 31 21:02:18 EST 1995