screen(graphics)
screen()所属R语言包:graphics
Creating and Controlling Multiple Screens on a Single Device
在单个设备上创建和控制多个屏幕
译者:生物统计家园网 机器人LoveR
描述----------Description----------
split.screen defines a number of regions within the current device which can, to some extent, be treated as separate graphics devices. It is useful for generating multiple plots on a single device. Screens can themselves be split, allowing for quite complex arrangements of plots.
split.screen定义一个区域内可以在一定程度上可以作为单独的图形设备处理当前设备的数量。它是产生一个单一的设备上的多个图。屏幕可以自行分裂,允许相当复杂的图安排。
screen is used to select which screen to draw in.
screen用于选择绘制英寸的屏幕
erase.screen is used to clear a single screen, which it does by filling with the background colour.
erase.screen是用来清除一个屏幕上,它确实与背景颜色填充。
close.screen removes the specified screen definition(s).
close.screen删除指定的屏幕清晰度(S)。
用法----------Usage----------
split.screen(figs, screen, erase = TRUE)
screen(n = , new = TRUE)
erase.screen(n = )
close.screen(n, all.screens = FALSE)
参数----------Arguments----------
参数:figs
A two-element vector describing the number of rows and the number of columns in a screen matrix or a matrix with 4 columns. If a matrix, then each row describes a screen with values for the left, right, bottom, and top of the screen (in that order) in NDC units, that is 0 at the lower left corner of the device surface, and 1 at the upper right corner.
一个两个元素的向量描述行和屏幕矩阵或4列的矩阵中的列数。如果一个矩阵,则每行描述与屏幕的左,右,底部,屏幕的上方(按顺序),NDC的单位,即0在较低的设备表面的左上角,1值右上角。
参数:screen
A number giving the screen to be split. It defaults to the current screen if there is one, otherwise the whole device region.
一个数字给被分割的屏幕。它默认为当前屏幕,如果有,否则整个装置区。
参数:erase
logical: should be selected screen be cleared?
逻辑:应选择屏幕被清除呢?
参数:n
A number indicating which screen to prepare for drawing (screen), erase (erase.screen), or close (close.screen). (close.screen will accept a vector of screen numbers.)
数字显示屏幕绘图准备(screen),擦除(erase.screen),或关闭(close.screen)。 (close.screen会接受一个屏幕数字向量。)
参数:new
A logical value indicating whether the screen should be erased as part of the preparation for drawing in the screen.
一个逻辑值,指示是否应作为编制在屏幕上绘图的一部分擦除屏幕。
参数:all.screens
A logical value indicating whether all of the screens should be closed.
一个逻辑值,该值指示是否应关闭所有屏幕。
Details
详情----------Details----------
The first call to split.screen places R into split-screen mode. The other split-screen functions only work within this mode. While in this mode, certain other commands should be avoided (see the Warnings section below). Split-screen mode is exited by the command close.screen(all = TRUE).
在第一次调用split.screen地方ŕ到分屏模式。其他分屏功能,只有在这种模式下工作。虽然在这种模式下,应尽量避免某些其他命令(见下面“警告”一节)。分屏模式退出命令close.screen(all = TRUE)。
If the current screen is closed, close.screen sets the current screen to be the next larger screen number if there is one, otherwise to the first available screen.
如果当前屏幕是关闭的,close.screen当前屏幕设置为下一个更大的屏幕数量,如果有一个,否则第一个可用的屏幕。
值----------Value----------
split.screen returns a vector of screen numbers for the newly-created screens. With no arguments, split.screen returns a vector of valid screen numbers.
split.screen返回新创建的屏幕一个屏幕数字向量。不带任何参数,split.screen返回一个有效的屏幕号码的向量。
screen invisibly returns the number of the selected screen. With no arguments, screen returns the number of the current screen.
screen无形返回选定屏幕上的数目。不带任何参数,screen返回当前屏幕的数量。
close.screen returns a vector of valid screen numbers.
close.screen返回一个有效的屏幕号码的向量。
screen, erase.screen, and close.screen all return FALSE if R is not in split-screen mode.
screen,erase.screen,close.screen所有返回FALSE如果R是不是在分屏模式。
警告----------Warnings----------
The recommended way to use these functions is to completely draw a plot and all additions (i.e. points and lines) to the base plot, prior to selecting and plotting on another screen. The behavior associated with returning to a screen to add to an existing plot is unpredictable and may result in problems that are not readily visible.
推荐的方法使用这些功能是完全绘制的基本图之前,另一个屏幕上的选择和策划图和所有增加(即点,线)。返回到屏幕上,添加到现有的图有关的行为是不可预测的,并可能导致的问题,是不容易看见。
These functions are totally incompatible with the other mechanisms for arranging plots on a device: par(mfrow), par(mfcol) and layout().
这些功能是完全不与其他机制的安排在设备上图:par(mfrow),par(mfcol)和layout()。
The functions are also incompatible with some plotting functions, such as coplot, which make use of these other mechanisms.
一些绘图功能,如coplot,使这些机制的使用,功能也不相容。
erase.screen will appear not to work if the background colour is transparent (as it is by default on most devices).
erase.screen会出现无法正常工作,如果背景颜色是透明的(因为它是默认情况下,大多数设备)。
参考文献----------References----------
Statistical Models in S. Wadsworth & Brooks/Cole.
参见----------See Also----------
par, layout, Devices, dev.*
par,layout,Devices,dev.*
举例----------Examples----------
if (interactive()) {
par(bg = "white") # default is likely to be transparent[默认情况下是有可能的是透明]
split.screen(c(2,1)) # split display into two screens[分成两个屏幕显示]
split.screen(c(1,3), screen = 2) # now split the bottom half into 3[现在分成3个下半区]
screen(1) # prepare screen 1 for output[准备输出画面1]
plot(10:1)
screen(4) # prepare screen 4 for output[准备输出屏幕4]
plot(10:1)
close.screen(all = TRUE) # exit split-screen mode[退出分割画面模式]
split.screen(c(2,1)) # split display into two screens[分成两个屏幕显示]
split.screen(c(1,2),2) # split bottom half in two[在两个分裂的下半部]
plot(1:10) # screen 3 is active, draw plot[屏幕3活跃,绘制图]
erase.screen() # forgot label, erase and redraw[忘了标签,清除和重绘]
plot(1:10, ylab= "ylab 3")
screen(1) # prepare screen 1 for output[准备输出画面1]
plot(1:10)
screen(4) # prepare screen 4 for output[准备输出屏幕4]
plot(1:10, ylab="ylab 4")
screen(1, FALSE) # return to screen 1, but do not clear[返回到屏幕1,但不清除]
plot(10:1, axes=FALSE, lty=2, ylab="") # overlay second plot[覆盖第二个图]
axis(4) # add tic marks to right-hand axis[tic标记添加到右侧轴]
title("Plot 1")
close.screen(all = TRUE) # exit split-screen mode[退出分割画面模式]
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|