split.screen(figs, screen=<<see below>>, erase=T) screen(n=<<see below>>, new = T) erase.screen(n=<<see below>>, eject = F) close.screen(n, all = F) prompt.screen(delta = 1/8, draw = T)
close.screen returns the index numbers of the active screens left.
screen, erase.screen, and close.screen return FALSE if invoked outside the split-screen environment.
prompt.screen returns an N by 4 matrix of screen coordinates where N is determined by the desired number of screens entered interactively and the coordinates are determined by a point-and-click interaction using locator. This matrix can then be given to split.screen to set up a multiple screen environment.
erase.screen causes the first valid screen to be made active (in most cases this is screen 1) on exit.
close.screen closes (i.e., disables) the specified screens. Graphics output present at closing is left intact.
Graphics input and output is directed to and from different screens by calling screen to designate the active one. If you move to a new screen and new is FALSE, then a call to a high-level plot function will not clear it; the plot will be superimposed on anything already on the screen. If, however, you call high-level plot functions twice in an active screen, the second call starts a new page, and all the other screens on that page will be empty.
As part of the initialization, split.screen activates the first screen in figs.
Screens can be recursively divided. See the examples.
Use close.screen(all=T) to "unsplit" the display.
Outer margins are not defined in the context of split-screens, thus the graphics parameters oma and omi should not be used.
If any screen in figs is smaller than half of the horizontal or vertical dimensions of the graphics display, the character expansion factor parameter cex is set to 0.5 in all the screens.
They cannot be used with multiple devices either.
#Example 1 split.screen(c(2,1)) # split display into two screens [1] 1 2 split.screen(c(1,3), screen = 2) # now split the bottom half into 3 [1] 3 4 5 screen(1) # prepare screen 1 for output tsplot(lynx) screen(4) # prepare screen 4 for output tsplot(lag(lynx)) dev.print() close.screen(all = T) # exit split-screen mode#Example 2 split.screen(c(2,1)) # split display into two screens [1] 1 2 split.screen(c(1,2),2) # split bottom half in two [1] 3 4 tsplot(corn.rain) # screen 3 is active, draw plot erase.screen() #forgot label, erase and redraw tsplot(corn.rain, ylab= "rain in inches") screen(1) # prepare screen 1 for output tsplot(corn.rain) legend(1902, 9, c("corn", "yield"), lty=1:2) screen(4) # prepare screen 4 for output tsplot(corn.yield, ylab="yield in bushels/acre") screen(1, F) #return to screen 1, but do not clear tsplot(window(corn.yield, start(corn.yield), end(corn.yield)), axes = F, lty = 2) # overlay second plot axis(4) # add tic marks to right-hand axis title("Rainfall and Corn Yield in six Cornbelt States")
#Example 3 # decide the positioning of screens interactively split.screen(prompt.screen())